Virt-customize: Difference between revisions

From Leo's Notes
This page was last edited on 30 December 2021, at 01:12.
Created page with "virt-customize is a tool that can customize virtual machine disk images in both raw and qcow2 formats. == Installation == On CentOS/RHEL or Ubuntu, install the libguestfs-too..."
 
m Added categories and navbox
 
Line 34: Line 34:
|}
|}


 
{{Navbox Linux}}
 
[[Category:Linux]]
<br />
[[Category:LinuxUtilities]]

Latest revision as of 01:12, 30 December 2021

virt-customize is a tool that can customize virtual machine disk images in both raw and qcow2 formats.

Installation

On CentOS/RHEL or Ubuntu, install the libguestfs-tools package.

Usage

To modify images directly, set LIBGUESTFS_BACKEND=direct.

Cheat sheet

Run: export LIBGUESTFS_BACKEND=direct then one of the commands below.

Task Command
Set the root password virt-customize -a vm_image.qcow2 --root-password password:new-password
Install packages virt-customize -a vm_image.qcow2 --install [vim,bash-completion,wget,curl,telnet,unzip]
Update packages virt-customize -a vm_image.qcow2 --update
Upload a file into the VM virt-customize -a vm_image.qcow2 --upload dhcp.conf:/etc/dhcp.conf
Set timezone virt-customize -a vm_image.qcow2 --timezone "America/Edmonton"
Add an authorized key to root or some other user virt-customize -a vm_image.qcow2 --ssh-inject root:./id_rsa.pub

virt-customize -a vm_image.qcow2 --ssh-inject some-username:./id_rsa.pub