Installing a Xen Guest OS from the Command-line (virt-install)

From Techotopia
Jump to: navigation, search
PreviousTable of ContentsNext
Managing and Monitoring Fedora based Xen Guest SystemsManaging Xen using the xm Command-line Tool

Take your Fedora Linux Skills to the Next Level
Fedora 31 Essentials book is now available in Print ($36.99) and eBook ($24.99) editions. Learn more...

Buy Print Preview Book

In the previous chapters we explored the creation and management of Xen guest operating systems using the virt-manager graphical tool. In this chapter we will cover the installation of a Xen guest operating system using the virt-install' command-line tool.

This chapter assumes that the Xen kernel is running and that the system hardware supports Xen virtualization. For details on these requirements read Installing and Configuring Fedora Xen Virtualization.

Preparing the System for virt-install

virt-install provides the option of supporting graphics for the guest operating system installation. This is achieved through use of VNC. If graphics support is declined during the virt-install session, the standard text based installer will be used.

If you prefer to use the graphical installer for the guest operating system it is necessary to ensure that the vncviewer is installed, otherwise virt-install will fail to create the new guest system.

Fedora Linux does not install VNC by default. To verify whether VNC is installed, run the following command from a Terminal Window:

rpm -q vnc

If rpm reports that VNC is not installed, it may be installed as follows:

su -
yum install vnc

Running virt-install to Build the Xen Guest System

virt-install must be run as root and, once invoked, will ask a number of questions before creating the guest system. The question are as follows:

  • What is the name of your virtual machine? - The name by which the guest system will be referenced when managing and monitoring the system with other tools.
  • How much RAM should be allocated (in megabytes)? - The amount of system memory to be made available to the guest operating system.
  • What would you like to use as the disk (path)? - The path to the file or disk partition to be used to contain the guest operating system.
  • Would you like to enable graphics support? (yes or no) - Defines whether the graphical installer is used (in a VNC window) or the text based installer in the shell.
  • What is the install location? - The location of the installation files for the OS. This can be an ftp, nfs, http, ISO image or local CD or DVD device location.

The following transcript shows a typical virt-install session:

[root@fedora7 ~]# virt-install
What is the name of your virtual machine? myXenGuest
 How much RAM should be allocated (in megabytes)? 300
 What would you like to use as the disk (path)? /home/nas/xenGuest.dsk
 How large would you like the disk (/home/nas/xenGuest.dsk) to be (in gigabytes)? 3
 Would you like to enable graphics support? (yes or no) yes
 What is the install location? http://download.fedora.redhat.com/pub/fedora/linux/releases/7/Fedora/i386/os/
 

Starting install...
libvir: Xen Daemon error : GET operation failed: 
Retrieving file Fedora...                                       434 kB 00:02 
Retrieving file vmlinuz.. 100% |=========================| 2.1 MB    00:11     
Retrieving file initrd.im 100% |=========================| 5.4 MB    00:27     
libvir: Xen Daemon error : GET operation failed: 
Creating storage file...  100% |=========================| 3.0 GB    00:00     
Creating domain...                                                 0 B 00:06 

VNC Viewer Free Edition 4.1.2 for X - built Jun 11 2007 09:44:52
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Thu Aug 30 12:01:33 2007
 CConn:       connected to host localhost port 5900
 CConnection: Server supports RFB protocol version 3.8
 CConnection: Using RFB protocol version 3.8

Thu Aug 30 12:01:34 2007
 TXImage:     Using default colormap and visual, TrueColor, depth 24.
 CConn:       Using pixel format depth 6 (8bpp) rgb222
 CConn:       Using ZRLE encoding


Once the guest system has been created, the vncviewer screen will appear containing the operating system installer:

Xen Guest Fedora Installer running in VNC window

Follow the standard installation procedure for the guest operating system.

Once the installation is completed the next step is to learn how to administer the guest system. This can be achieved either using the graphical virt-manager tool (see Managing and Monitoring Fedora based Xen Guest Systems) or using the command line xm tool (see Managing Xen using the xm Command-line Tool).

Take your Fedora Linux Skills to the Next Level
Fedora 31 Essentials book is now available in Print ($36.99) and eBook ($24.99) editions. Learn more...

Buy Print Preview Book