How can I deploy an OS on a VM skipping the steps of installation?

0

If I have a virtual machine, how can I install on it an operating system skipping the installation steps?

In other words, when I choose an operating system to be installed on the VM, I want to use it immediately without bothering with the installation steps (like choosing the language, username, etc)

Also how can it be a headless VM? Meaning that I don't need the OS with a graphical user interface. I only want to use it via the terminal.

Is there anyway that I can do that?

Note: I am using KVM and libvirt.

Please help ASAP.

Thanks.

NSD

Posted 2017-03-14T14:33:54.923

Reputation: 59

depending on the guest OS you want, your options are (1) install yourself or (2) copy an already-installed version from someone else. option (1) can vary widely and does not always involve official installers (see eg debootstrap). (option (2) has security implications. how much do you trust the source?) – quixotic – 2017-03-14T16:11:29.700

Answers

0

The 'virt-install' command line tool has the ability to just setup a pre-installed disk image, instead of running an installer. Just use the '--import' command line argument. eg as root

# virt-install --name demo \ --memory 512 \ --disk path=/var/lib/libvirt/images/fedora-25.img,format=raw \ --import

this sets up graphic display with a VNC or SPICE server by default. If you really just want a plain serial console add --graphics none to the args. The 'virt-install' man page details various other options you can use.

If you don't have a pre-installed disk image already, then you can use the 'virt-builder' tool to fetch one for certain OS. eg

# virt-builder fedora-25 -o /var/lib/libvirt/images/fedora-25.img

will download a pre-built fedora 25 image.

DanielB

Posted 2017-03-14T14:33:54.923

Reputation: 221

How can I make my own image with my own configuration? – NSD – 2017-03-14T15:21:39.837