Xen3: Zero to Xen from the CLI in OpenSuSE 10.3
From openSUSE
Contents |
Xen3: Zero to Xen from the CLI in openSUSE 10.3
A step-by-step how-to guide on getting from bare metal to a openSUSE 10.3 Dom0 and openSUSE 10.3 PV DomU from the command line.
Install openSUSE 10.3 on your dom0.
I did this with the net-installer: openSUSE-10.3-GM-i386-mini.iso
When you get to the software configuration screen, under "Base Technologies" select the following:
Install Xen on your Dom0
I am going to remove the repos which are already here and point this at my company's internal openSUSE Mirror. Feel free to keep it default or point it to wherever you want.
List repos:
zypper lr
Remove all of them:
zypper rr http://download.opensuse.org/distribution/10.3/repo/debug/ zypper rr http://download.opensuse.org/distribution/10.3/repo/non-oss/ zypper rr "openSUSE-10.3-FTP 10.3"
Add your own repos:
zypper ar http://suseupdate.mydomain.net/suse-install/10.3/update/ http://suseupdate.mydomain.net/suse-install/10.3/update/ zypper ar http://suseupdate.mydomain.net/suse-install/10.3/non-oss/ http://suseupdate.mydomain.net/suse-install/10.3/non-oss/ zypper ar http://suseupdate.mydomain.net/suse-install/10.3/oss/ http://suseupdate.mydomain.net/suse-install/10.3/oss/
Get the latest updates:
zypper up Continue? [yes/no]: yes WARNING: One of installed patches affects the package manager itself, thus it requires its restart before executing any further operations. reboot
Once the system is back up, login as root:
zypper up Continue? [yes/no]: yes In order to install this package, you must agree to terms of the above licencse. Continue? [yes/no]: yes In order to install this package, you must agree to terms of the above licencse. Continue? [yes/no]: yes In order to install this package, you must agree to terms of the above licencse. Continue? [yes/no]: yes In order to install this package, you must agree to terms of the above licencse. Continue? [yes/no]: yes In order to install this package, you must agree to terms of the above licencse. Continue? [yes/no]: yes WARNING: One of installed patches requires a reboot of your machine. Please do it as soon as possible. reboot
Once the system is back up, login as root:
zypper shell #You can skip this next line if you like, but I want these things on my machine: zypper> install iputils man bind-util vim-enhanced tcpdump rsync wget #This set you need for Xen: zypper> install xen xen-libs xen-tools xen-tools-ioemu kernel-xen vm-install #The xen kernel was just added to your grub config, but it is not the default. To fix this: vi /boot/grub/menu.lst default 0 reboot
Once the system comes back up, login as root. If the system booted the xen kernel, you should see it in uname:
uname -a Linux xen02 2.6.22.17-0.1-xen #1 SMP 2008/02/10 20:01:04 UTC i686 i686 i386 GNU/Linux
vm-install will guide you through installing your domU. I will install an openSUSE 10.3 guest:
vm-install Gathering settings... Please specify the type of operating system that will run within the virtual machine. This defines many defaults, and helps decide how to start paravirtualized operating systems. 1: Novell NetWare 6.5 SP6 and older 2: Novell Open Enterprise Server 2 (Linux) 3: Novell Open Enterprise Server 2 (NetWare) 4: Other operating system 5: RedHat (other) 6: RedHat Enterprise Linux 3 7: RedHat Enterprise Linux 4 8: RedHat Enterprise Linux 5 9: SUSE (other) 10: SUSE Linux Enterprise Desktop 10 11: SUSE Linux Enterprise Server 8 12: SUSE Linux Enterprise Server 9 13: SUSE Linux Enterprise Server 10 14: Solaris 9 and older 15: Solaris 10 16: Windows (other) 17: Windows (other, x64) 18: Windows NT 19: Windows Server 2008 20: Windows Server 2008 (x64) 21: Windows Vista 22: Windows Vista (x64) 23: Windows XP, 2000, 2003 24: Windows XP, 2003 (x64) 25: openSUSE [25] > 25 Please choose a name for the virtual machine. [opensuse] > seraphi_guest Specify the amount of memory and number of processors to allocate for the VM. Initial Memory [384] > 384 Maximum Memory [2048] > 512 Virtual Processors [1] > 1 Please specify the type of virtualized graphics hardware. 1: No Graphics Support 2: Paravirtualized Graphics Adapter [2] > 2 Virtual Disks: (None) Do you want to add another virtual disk? (Y / N) [Y] > Y Create a virtual disk based on a device (CD or other block device), an existing image file (ISO), or a new file. Specify a device by its device node, such as /dev/cdrom, not its mount point. What type of virtual disk do you want to add? 1: CD-ROM or DVD 2: Hard Disk [2] > 2 Where will the virtual disk physically reside? [/var/lib/xen/images/seraphi_guest/xvda] > Size (GB) [4.0] > Virtual Disks: 4.0 GB Hard Disk (file:/var/lib/xen/images/seraphi_guest/xvda) Do you want to add another virtual disk? (Y / N) [N] > Network Adapters (None) Do you want to add another virtual network adapter? (Y / N) [Y] > Network Adapters Paravirtualized; Randomly generated MAC address Do you want to add another virtual network adapter? (Y / N) [N] > Specify the bootable virtual disk (often labeled as Disk 1) or the network installation source URL. Each CD, DVD, or ISO image required for installation must be added as a virtual disk. 1: Network URL (ftp://, http://, nfs://, smb://) [1] > 1 Type the install URL: > http://suseupdate.mydomain.net/suse-install/10.3/oss/ Some operating systems support automating the installation by specifying a URL or file(s). Select a directory to include multiple files. AutoYaST file > Some operating systems accept additional arguments, used to customize the installation or boot process. Additional Arguments > Preparing to start the installation... Installing... Failed to display the VM's console because DISPLAY is not set. Please connect a VNC viewer to localhost:5900.
Wait a second, this was the no GUI, CLI guide?! Well yes. You installed xen without a GUI, created your dom0 without a GUI, and with the same steps you can install a DomU without a GUI. If you want to try to install openSUSE without a gui, just change your answer to the display question to "1: No Graphics Support". It will load, but I had a very hard time navigating the text based menus over the virtual console and ssh. So, due to openSUSE's installer, I am recommending that you select "Paravirtualized Graphics Adapter", and then Load up a VNC Viewer to port 5900. This is just for the installation of the DomU OS.
SSH to your dom0(if you are not already doing all of this over ssh for some reason), and setup a port forward to connect port 5900 (or any free port) of your machine to port 5900 of the dom0. You will get a GUI openSUSE installer, which looks and works exactly as the non-virtual install of your dom0.
Eventually the installer will reboot your domU. When this happens, you need to reconnect your VNC connection to begin phase 2 of the installer.
Once your installed, you can close VNC and get back on your Dom0 shell.
View your running domains:
xm list Name ID Mem VCPUs State Time(s) Domain-0 0 232 2 r----- 718.1 seraphi_guest 16 384 1 -b---- 8.2
Other cool commands are
xm help xm top
connect to the shell of your new running guest domain
xm console seraphi_guest Welcome to openSUSE 10.3 (i586) - Kernel 2.6.22.5-31-xen (xvc0). seraphi_guest login:
To disconnect from the console, the escape is "ctrl + ]"

