Make a KVM VM but skip Ubuntu installation process [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I am currently able to make a Ubuntu 16.04 VM via KVM on my host Ubuntu.



What I'm trying is to install the Ubuntu image but then not have to go through the installation process of choosing a username, password, machine name, and time zone.



Is it possible to do this via KVM?










share|improve this question















closed as too broad by user117103, waltinator, ravery, muru, Eric Carvalho Mar 1 at 23:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Have you considered using Kickstart to automate the installation?
    – dsstorefile1
    Feb 27 at 14:57










  • That seems like the perfect solution! But I can't seem to find the libvirt xml command for extra arguments
    – nadermx
    Feb 27 at 15:14










  • the command is <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
    – nadermx
    Feb 27 at 15:22






  • 1




    Have you solved your own problem? If so, please consider posting an answer in the answer box down below
    – Zanna
    Mar 1 at 14:43






  • 1




    @Zanna Answered...
    – Elder Geek
    Mar 1 at 16:29














up vote
0
down vote

favorite












I am currently able to make a Ubuntu 16.04 VM via KVM on my host Ubuntu.



What I'm trying is to install the Ubuntu image but then not have to go through the installation process of choosing a username, password, machine name, and time zone.



Is it possible to do this via KVM?










share|improve this question















closed as too broad by user117103, waltinator, ravery, muru, Eric Carvalho Mar 1 at 23:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Have you considered using Kickstart to automate the installation?
    – dsstorefile1
    Feb 27 at 14:57










  • That seems like the perfect solution! But I can't seem to find the libvirt xml command for extra arguments
    – nadermx
    Feb 27 at 15:14










  • the command is <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
    – nadermx
    Feb 27 at 15:22






  • 1




    Have you solved your own problem? If so, please consider posting an answer in the answer box down below
    – Zanna
    Mar 1 at 14:43






  • 1




    @Zanna Answered...
    – Elder Geek
    Mar 1 at 16:29












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am currently able to make a Ubuntu 16.04 VM via KVM on my host Ubuntu.



What I'm trying is to install the Ubuntu image but then not have to go through the installation process of choosing a username, password, machine name, and time zone.



Is it possible to do this via KVM?










share|improve this question















I am currently able to make a Ubuntu 16.04 VM via KVM on my host Ubuntu.



What I'm trying is to install the Ubuntu image but then not have to go through the installation process of choosing a username, password, machine name, and time zone.



Is it possible to do this via KVM?







system-installation kvm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 1 at 14:42









Zanna

48.2k13120228




48.2k13120228










asked Feb 27 at 14:49









nadermx

1256




1256




closed as too broad by user117103, waltinator, ravery, muru, Eric Carvalho Mar 1 at 23:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by user117103, waltinator, ravery, muru, Eric Carvalho Mar 1 at 23:28


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • Have you considered using Kickstart to automate the installation?
    – dsstorefile1
    Feb 27 at 14:57










  • That seems like the perfect solution! But I can't seem to find the libvirt xml command for extra arguments
    – nadermx
    Feb 27 at 15:14










  • the command is <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
    – nadermx
    Feb 27 at 15:22






  • 1




    Have you solved your own problem? If so, please consider posting an answer in the answer box down below
    – Zanna
    Mar 1 at 14:43






  • 1




    @Zanna Answered...
    – Elder Geek
    Mar 1 at 16:29
















  • Have you considered using Kickstart to automate the installation?
    – dsstorefile1
    Feb 27 at 14:57










  • That seems like the perfect solution! But I can't seem to find the libvirt xml command for extra arguments
    – nadermx
    Feb 27 at 15:14










  • the command is <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
    – nadermx
    Feb 27 at 15:22






  • 1




    Have you solved your own problem? If so, please consider posting an answer in the answer box down below
    – Zanna
    Mar 1 at 14:43






  • 1




    @Zanna Answered...
    – Elder Geek
    Mar 1 at 16:29















Have you considered using Kickstart to automate the installation?
– dsstorefile1
Feb 27 at 14:57




Have you considered using Kickstart to automate the installation?
– dsstorefile1
Feb 27 at 14:57












That seems like the perfect solution! But I can't seem to find the libvirt xml command for extra arguments
– nadermx
Feb 27 at 15:14




That seems like the perfect solution! But I can't seem to find the libvirt xml command for extra arguments
– nadermx
Feb 27 at 15:14












the command is <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
– nadermx
Feb 27 at 15:22




the command is <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
– nadermx
Feb 27 at 15:22




1




1




Have you solved your own problem? If so, please consider posting an answer in the answer box down below
– Zanna
Mar 1 at 14:43




Have you solved your own problem? If so, please consider posting an answer in the answer box down below
– Zanna
Mar 1 at 14:43




1




1




@Zanna Answered...
– Elder Geek
Mar 1 at 16:29




@Zanna Answered...
– Elder Geek
Mar 1 at 16:29










2 Answers
2






active

oldest

votes

















up vote
1
down vote













If you already have an installed VM you can simply copy the installed VM This would allow you to go through the installation process only once although you may have to do some editing...



First copy the VM's disks from /var/lib/libvirt/images on src host to the same dir on destination host.



Next, run virsh dumpxml VMNAME > domxml.xml on the source host and copy this xml to the dest. host



Then, on the destination host run virsh define domxml.xml



and start the VM.



Addendum: If the VM has snapshots that you want to preserve, you should dump the snapshot xml-files on the source with virsh snapshot-dumpxml $dom $name > file.xml for each snapshot in the snapshot list of the VM virsh snapshot-list --name $dom.



Then on the destination use virsh snapshot-create --redefine $dom file.xml to finish migrating the snapshots.



If you also care about which snapshot is the current one, then additionally do on the source:
virsh snapshot-current --name $dom
and on the destination:
virsh snapshot-current $dom $name



Note:
If the disk location differs, you need to edit the xml's devices/disk node to point to the image on the destination host
If the VM is attached to custom defined networks, you'll need to either edit them out of the xml on the destination host or redefine them as well (virsh net-dumpxml > netxml.xml and the virsh net-define netxml.xml && virsh net-start NETNAME & virsh net-autostart NETNAME)



Sources:
This answer shamelessly modeled on answers found on



https://serverfault.com/questions/434064/correct-way-to-move-kvm-vm






share|improve this answer



























    up vote
    0
    down vote













    You can use virt-builder to create virtual machine images of a wide variety of Linux distributions.



    Virt-builder is included in the libguestfs-tools package. Install it with:



    sudo apt-get install libguestfs-tools


    You run virt-builder by telling it what Linux distribution you want to build an image for. To learn what virtual machines it can build, run:



    virt-builder --list
    ....
    ubuntu-10.04 x86_64 Ubuntu 10.04 (Lucid)
    ubuntu-12.04 x86_64 Ubuntu 12.04 (Precise)
    ubuntu-14.04 x86_64 Ubuntu 14.04 (Trusty)
    ubuntu-16.04 x86_64 Ubuntu 16.04 (Xenial)


    To build a virtual machine, specify whether you want a raw or QCOW2 image, the disk size you want, and a filename, and go:



    virt-builder ubuntu-16.04 --format qcow2 --size 10G --output my-ubuntu-vm.qcow2


    By default, virt-builder will enable the root account and set a random password for it. If you don't want this, you can set your own root password. You can also add user accounts, install or remove packages, set the VM hostname, and even run arbitrary commands. The virt-builder man page has all the details on these, if you need them.






    share|improve this answer



























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      If you already have an installed VM you can simply copy the installed VM This would allow you to go through the installation process only once although you may have to do some editing...



      First copy the VM's disks from /var/lib/libvirt/images on src host to the same dir on destination host.



      Next, run virsh dumpxml VMNAME > domxml.xml on the source host and copy this xml to the dest. host



      Then, on the destination host run virsh define domxml.xml



      and start the VM.



      Addendum: If the VM has snapshots that you want to preserve, you should dump the snapshot xml-files on the source with virsh snapshot-dumpxml $dom $name > file.xml for each snapshot in the snapshot list of the VM virsh snapshot-list --name $dom.



      Then on the destination use virsh snapshot-create --redefine $dom file.xml to finish migrating the snapshots.



      If you also care about which snapshot is the current one, then additionally do on the source:
      virsh snapshot-current --name $dom
      and on the destination:
      virsh snapshot-current $dom $name



      Note:
      If the disk location differs, you need to edit the xml's devices/disk node to point to the image on the destination host
      If the VM is attached to custom defined networks, you'll need to either edit them out of the xml on the destination host or redefine them as well (virsh net-dumpxml > netxml.xml and the virsh net-define netxml.xml && virsh net-start NETNAME & virsh net-autostart NETNAME)



      Sources:
      This answer shamelessly modeled on answers found on



      https://serverfault.com/questions/434064/correct-way-to-move-kvm-vm






      share|improve this answer
























        up vote
        1
        down vote













        If you already have an installed VM you can simply copy the installed VM This would allow you to go through the installation process only once although you may have to do some editing...



        First copy the VM's disks from /var/lib/libvirt/images on src host to the same dir on destination host.



        Next, run virsh dumpxml VMNAME > domxml.xml on the source host and copy this xml to the dest. host



        Then, on the destination host run virsh define domxml.xml



        and start the VM.



        Addendum: If the VM has snapshots that you want to preserve, you should dump the snapshot xml-files on the source with virsh snapshot-dumpxml $dom $name > file.xml for each snapshot in the snapshot list of the VM virsh snapshot-list --name $dom.



        Then on the destination use virsh snapshot-create --redefine $dom file.xml to finish migrating the snapshots.



        If you also care about which snapshot is the current one, then additionally do on the source:
        virsh snapshot-current --name $dom
        and on the destination:
        virsh snapshot-current $dom $name



        Note:
        If the disk location differs, you need to edit the xml's devices/disk node to point to the image on the destination host
        If the VM is attached to custom defined networks, you'll need to either edit them out of the xml on the destination host or redefine them as well (virsh net-dumpxml > netxml.xml and the virsh net-define netxml.xml && virsh net-start NETNAME & virsh net-autostart NETNAME)



        Sources:
        This answer shamelessly modeled on answers found on



        https://serverfault.com/questions/434064/correct-way-to-move-kvm-vm






        share|improve this answer






















          up vote
          1
          down vote










          up vote
          1
          down vote









          If you already have an installed VM you can simply copy the installed VM This would allow you to go through the installation process only once although you may have to do some editing...



          First copy the VM's disks from /var/lib/libvirt/images on src host to the same dir on destination host.



          Next, run virsh dumpxml VMNAME > domxml.xml on the source host and copy this xml to the dest. host



          Then, on the destination host run virsh define domxml.xml



          and start the VM.



          Addendum: If the VM has snapshots that you want to preserve, you should dump the snapshot xml-files on the source with virsh snapshot-dumpxml $dom $name > file.xml for each snapshot in the snapshot list of the VM virsh snapshot-list --name $dom.



          Then on the destination use virsh snapshot-create --redefine $dom file.xml to finish migrating the snapshots.



          If you also care about which snapshot is the current one, then additionally do on the source:
          virsh snapshot-current --name $dom
          and on the destination:
          virsh snapshot-current $dom $name



          Note:
          If the disk location differs, you need to edit the xml's devices/disk node to point to the image on the destination host
          If the VM is attached to custom defined networks, you'll need to either edit them out of the xml on the destination host or redefine them as well (virsh net-dumpxml > netxml.xml and the virsh net-define netxml.xml && virsh net-start NETNAME & virsh net-autostart NETNAME)



          Sources:
          This answer shamelessly modeled on answers found on



          https://serverfault.com/questions/434064/correct-way-to-move-kvm-vm






          share|improve this answer












          If you already have an installed VM you can simply copy the installed VM This would allow you to go through the installation process only once although you may have to do some editing...



          First copy the VM's disks from /var/lib/libvirt/images on src host to the same dir on destination host.



          Next, run virsh dumpxml VMNAME > domxml.xml on the source host and copy this xml to the dest. host



          Then, on the destination host run virsh define domxml.xml



          and start the VM.



          Addendum: If the VM has snapshots that you want to preserve, you should dump the snapshot xml-files on the source with virsh snapshot-dumpxml $dom $name > file.xml for each snapshot in the snapshot list of the VM virsh snapshot-list --name $dom.



          Then on the destination use virsh snapshot-create --redefine $dom file.xml to finish migrating the snapshots.



          If you also care about which snapshot is the current one, then additionally do on the source:
          virsh snapshot-current --name $dom
          and on the destination:
          virsh snapshot-current $dom $name



          Note:
          If the disk location differs, you need to edit the xml's devices/disk node to point to the image on the destination host
          If the VM is attached to custom defined networks, you'll need to either edit them out of the xml on the destination host or redefine them as well (virsh net-dumpxml > netxml.xml and the virsh net-define netxml.xml && virsh net-start NETNAME & virsh net-autostart NETNAME)



          Sources:
          This answer shamelessly modeled on answers found on



          https://serverfault.com/questions/434064/correct-way-to-move-kvm-vm







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 1 at 16:27









          Elder Geek

          25.4k949120




          25.4k949120






















              up vote
              0
              down vote













              You can use virt-builder to create virtual machine images of a wide variety of Linux distributions.



              Virt-builder is included in the libguestfs-tools package. Install it with:



              sudo apt-get install libguestfs-tools


              You run virt-builder by telling it what Linux distribution you want to build an image for. To learn what virtual machines it can build, run:



              virt-builder --list
              ....
              ubuntu-10.04 x86_64 Ubuntu 10.04 (Lucid)
              ubuntu-12.04 x86_64 Ubuntu 12.04 (Precise)
              ubuntu-14.04 x86_64 Ubuntu 14.04 (Trusty)
              ubuntu-16.04 x86_64 Ubuntu 16.04 (Xenial)


              To build a virtual machine, specify whether you want a raw or QCOW2 image, the disk size you want, and a filename, and go:



              virt-builder ubuntu-16.04 --format qcow2 --size 10G --output my-ubuntu-vm.qcow2


              By default, virt-builder will enable the root account and set a random password for it. If you don't want this, you can set your own root password. You can also add user accounts, install or remove packages, set the VM hostname, and even run arbitrary commands. The virt-builder man page has all the details on these, if you need them.






              share|improve this answer
























                up vote
                0
                down vote













                You can use virt-builder to create virtual machine images of a wide variety of Linux distributions.



                Virt-builder is included in the libguestfs-tools package. Install it with:



                sudo apt-get install libguestfs-tools


                You run virt-builder by telling it what Linux distribution you want to build an image for. To learn what virtual machines it can build, run:



                virt-builder --list
                ....
                ubuntu-10.04 x86_64 Ubuntu 10.04 (Lucid)
                ubuntu-12.04 x86_64 Ubuntu 12.04 (Precise)
                ubuntu-14.04 x86_64 Ubuntu 14.04 (Trusty)
                ubuntu-16.04 x86_64 Ubuntu 16.04 (Xenial)


                To build a virtual machine, specify whether you want a raw or QCOW2 image, the disk size you want, and a filename, and go:



                virt-builder ubuntu-16.04 --format qcow2 --size 10G --output my-ubuntu-vm.qcow2


                By default, virt-builder will enable the root account and set a random password for it. If you don't want this, you can set your own root password. You can also add user accounts, install or remove packages, set the VM hostname, and even run arbitrary commands. The virt-builder man page has all the details on these, if you need them.






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  You can use virt-builder to create virtual machine images of a wide variety of Linux distributions.



                  Virt-builder is included in the libguestfs-tools package. Install it with:



                  sudo apt-get install libguestfs-tools


                  You run virt-builder by telling it what Linux distribution you want to build an image for. To learn what virtual machines it can build, run:



                  virt-builder --list
                  ....
                  ubuntu-10.04 x86_64 Ubuntu 10.04 (Lucid)
                  ubuntu-12.04 x86_64 Ubuntu 12.04 (Precise)
                  ubuntu-14.04 x86_64 Ubuntu 14.04 (Trusty)
                  ubuntu-16.04 x86_64 Ubuntu 16.04 (Xenial)


                  To build a virtual machine, specify whether you want a raw or QCOW2 image, the disk size you want, and a filename, and go:



                  virt-builder ubuntu-16.04 --format qcow2 --size 10G --output my-ubuntu-vm.qcow2


                  By default, virt-builder will enable the root account and set a random password for it. If you don't want this, you can set your own root password. You can also add user accounts, install or remove packages, set the VM hostname, and even run arbitrary commands. The virt-builder man page has all the details on these, if you need them.






                  share|improve this answer












                  You can use virt-builder to create virtual machine images of a wide variety of Linux distributions.



                  Virt-builder is included in the libguestfs-tools package. Install it with:



                  sudo apt-get install libguestfs-tools


                  You run virt-builder by telling it what Linux distribution you want to build an image for. To learn what virtual machines it can build, run:



                  virt-builder --list
                  ....
                  ubuntu-10.04 x86_64 Ubuntu 10.04 (Lucid)
                  ubuntu-12.04 x86_64 Ubuntu 12.04 (Precise)
                  ubuntu-14.04 x86_64 Ubuntu 14.04 (Trusty)
                  ubuntu-16.04 x86_64 Ubuntu 16.04 (Xenial)


                  To build a virtual machine, specify whether you want a raw or QCOW2 image, the disk size you want, and a filename, and go:



                  virt-builder ubuntu-16.04 --format qcow2 --size 10G --output my-ubuntu-vm.qcow2


                  By default, virt-builder will enable the root account and set a random password for it. If you don't want this, you can set your own root password. You can also add user accounts, install or remove packages, set the VM hostname, and even run arbitrary commands. The virt-builder man page has all the details on these, if you need them.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 1 at 18:07









                  Michael Hampton

                  957719




                  957719












                      Popular posts from this blog

                      pylint3 and pip3 broken

                      Missing snmpget and snmpwalk

                      How to enroll fingerprints to Ubuntu 17.10 with VFS491