Quantcast
Channel: web-manual.net » Virtualization
Viewing all articles
Browse latest Browse all 4

Install Guest OS in KVM using Command Line

$
0
0

Install guest OS in KVM using command line – virt-install

In my previous article we’ve seen how to install guest OS in KVM using the graphical mode, i.e. using the virt-manager. In many of the cases probably you’ll not always have the graphical mode. In such scenario it is worthwhile to learn the installation using the command line tool.

Here in this article we’ll use the virt-install to install guest OS in KVM using command line.

virt-install supports rich set of options to install and also configure pre-installation options of a new guest OS. In the previous example we installed windows operating-system using the graphical virt-install tool. Here we will look into installing the same Windows XP having the same configuration but now using the command line.

For Windows operating-system

# virt-install –name cmdWinxp –ram 512 –disk path=/home/gun/cmdWinxp.img,size=5 –os-variant winxp –cdrom /home/gun/Wxp_sp2.iso

Starting install…
Creating storage file cmdWinxp.img | 5.0 GB 00:00
Creating domain… | 0 B 00:00
Domain installation still in progress. Waiting for installation to complete.

The above command will install a Virtual instance of the Windows XP operating system with name cmdWinxp having 512 MB available RAM. With the –disk option you can specify the destination path of the OS Image file and the size to allocate it. Since we are installing Windows XP we specified the –os-variant winxp. And finally the source of the installation ISO/CDROM. In our case it is an iso image of Windows XP located at /home/gun.

For more information about all the available option of virt-install you can consult the man page.

# man virt-install

At a first look these option may seem difficult to remember at one go. Dont worry, there is one very interesting option to consider and that is to install any Guest OS in an interactive manner with the –prompt option to the virt-install command. To demonstrate it, I’ll install Ubuntu 11.10 Guest OS in KVM using the interactive feature of the virt-install command.

[root@localhost gun]# virt-install –prompt
What is the name of your virtual machine? ububntu
How much RAM should be allocated (in megabytes)? 512
What would you like to use as the disk (file path)? /home/gun/ubnutu.img
How large would you like the disk (/home/gun/ubnutu.img) to be (in gigabytes)? 6
What is the install CD-ROM/ISO or URL? /home/gun/ubuntu-11.10-desktop-i386.iso

Starting install…
Creating storage file ubnutu.img | 6.0 GB 00:00
Creating domain… | 0 B 00:00

As you can see you dont have to remember all the options. You just need to type “virt-install –prompt” and it will ask you whatever it requires to make a It is very simple and easy.

The post Install Guest OS in KVM using Command Line appeared first on web-manual.net.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images