Difference between revisions of "Virt-builder"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{lowercase}}
 
<code>virt-builder</code><ref>http://libguestfs.org/virt-builder.1.html</ref> is a command line tool for building new virtual machines included in <code>[[libguestfs-tools]]</code> package.
 
<code>virt-builder</code><ref>http://libguestfs.org/virt-builder.1.html</ref> is a command line tool for building new virtual machines included in <code>[[libguestfs-tools]]</code> package.
 
+
http://libguestfs.org/virt-builder.1.html
 +
List of images: http://builder.libguestfs.org/
  
 
== Examples ==
 
== Examples ==
* <code>virt-builder --list</code> and <code>virt-builder --notes debian-9</code> to see if there is notes available.
+
* <code>virt-builder --list</code> and <code>virt-builder --notes [[debian-9]]</code> to see if there is notes available.
 
* <code>virt-builder debian-9 --format qcow2</code>
 
* <code>virt-builder debian-9 --format qcow2</code>
 
* <code>virt-builder debian-9 --format qcow2 --size 20G</code>
 
* <code>virt-builder debian-9 --format qcow2 --size 20G</code>
Line 10: Line 12:
 
* <code>virt-builder debian-9 --format qcow2 --size 20G --hostname MY_NEW_VM_NAME --install "PACKAGE_NAME_1,PACKAGE_NAME_2" --root-password password:YOUR_ROOT_PASS</code>
 
* <code>virt-builder debian-9 --format qcow2 --size 20G --hostname MY_NEW_VM_NAME --install "PACKAGE_NAME_1,PACKAGE_NAME_2" --root-password password:YOUR_ROOT_PASS</code>
  
 +
List of images: http://builder.libguestfs.org/
  
 
<pre>
 
<pre>
Line 32: Line 35:
  
  
Options:
+
Other options:
 
  --size 40G
 
  --size 40G
  
Line 38: Line 41:
  
 
To boot it under [[libvirt]] use <code>[[virt-install]] --import</code> command.
 
To boot it under [[libvirt]] use <code>[[virt-install]] --import</code> command.
 +
 +
== Errors ==
 +
<pre>
 +
postconf: warning: valid_hostname: invalid character 40(decimal): (none)
 +
postconf: fatal: unable to use my own hostname
 +
 +
Errors were encountered while processing:
 +
postfix
 +
mailutils
 +
E: Sub-process /usr/bin/dpkg returned an error code (1)
 +
 +
virt-builder: error:
 +
        export DEBIAN_FRONTEND=noninteractive
 +
        apt_opts='-q -y -o Dpkg::Options::=--force-confnew'
 +
        apt-get $apt_opts update
 +
        apt-get $apt_opts install 'libpcre3' 'libxml2' 'libgtk2.0-0'
 +
'libdbus-1-3' 'openssh-client' 'qemu-utils' 'debianutils' 'vim-tiny'
 +
'open-iscsi' 'xorg' 'xserver-xorg-video-all' 'fonts-dejavu' 'metacity'
 +
'network-manager' 'network-manager-gnome' 'dbus-x11' 'net-tools' 'curl'
 +
'ethtool' 'gawk' 'lsscsi' 'pciutils' 'usbutils' 'util-linux' 'xterm' 'less'
 +
'hwdata' 'hdparm' 'smartmontools'
 +
      : command exited with an error
 +
</pre>
 +
 +
== Related activities ==
 +
* [[Install KVM in an Ubuntu Server]]
 +
 +
== Related commands ==
 +
* {{virt-p2v}}
 +
* <code>[[virt-rescue]]</code> Run a rescue shell on a virtual machine
 +
* <code>[[virt-install]]</code>
 +
* <code>[[virt-sysprep]]</code>
 +
* <code>[[multipass launch]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 16:01, 7 November 2021

virt-builder[1] is a command line tool for building new virtual machines included in libguestfs-tools package.

http://libguestfs.org/virt-builder.1.html
List of images: http://builder.libguestfs.org/

Examples[edit]

  • virt-builder --list and virt-builder --notes debian-9 to see if there is notes available.
  • virt-builder debian-9 --format qcow2
  • virt-builder debian-9 --format qcow2 --size 20G
  • virt-builder debian-9 --format qcow2 --size 20G --hostname MY_NEW_VM_NAME
  • virt-builder debian-9 --format qcow2 --size 20G --hostname MY_NEW_VM_NAME --install "PACKAGE_NAME_1,PACKAGE_NAME_2"
  • virt-builder debian-9 --format qcow2 --size 20G --hostname MY_NEW_VM_NAME --install "PACKAGE_NAME_1,PACKAGE_NAME_2" --root-password password:YOUR_ROOT_PASS

List of images: http://builder.libguestfs.org/

virt-builder ubuntu-18.04 --format qcow2 --hostname YOUR_HOST_NAME --root-password password:YOUR_PASSWORD
[   2.0] Downloading: http://libguestfs.org/download/builder/ubuntu-18.04.xz
############################################################################################################## 100.0%#   ################################################################################################################### 100.0%
[ 286.1] Planning how to build this image
[ 286.1] Uncompressing
[ 288.2] Converting raw to qcow2
[ 291.1] Opening the new disk
[ 298.2] Setting a random seed
virt-builder: warning: random seed could not be set for this type of guest
[ 298.2] Setting the hostname: YOUR_HOST_NAME
[ 299.1] Setting passwords
[ 299.8] Finishing off
                   Output file: ubuntu-18.04.qcow2
                   Output size: 6.0G
                 Output format: qcow2
            Total usable space: 5.8G
                    Free space: 4.3G (74%)


Other options:

--size 40G


To boot it under libvirt use virt-install --import command.

Errors[edit]

postconf: warning: valid_hostname: invalid character 40(decimal): (none)
postconf: fatal: unable to use my own hostname

Errors were encountered while processing:
 postfix
 mailutils
E: Sub-process /usr/bin/dpkg returned an error code (1)

virt-builder: error: 
        export DEBIAN_FRONTEND=noninteractive
        apt_opts='-q -y -o Dpkg::Options::=--force-confnew'
        apt-get $apt_opts update
        apt-get $apt_opts install 'libpcre3' 'libxml2' 'libgtk2.0-0' 
'libdbus-1-3' 'openssh-client' 'qemu-utils' 'debianutils' 'vim-tiny' 
'open-iscsi' 'xorg' 'xserver-xorg-video-all' 'fonts-dejavu' 'metacity' 
'network-manager' 'network-manager-gnome' 'dbus-x11' 'net-tools' 'curl' 
'ethtool' 'gawk' 'lsscsi' 'pciutils' 'usbutils' 'util-linux' 'xterm' 'less' 
'hwdata' 'hdparm' 'smartmontools'
      : command exited with an error

Related activities[edit]

Related commands[edit]

See also[edit]

  • http://libguestfs.org/virt-builder.1.html
  • Advertising: