Friday, June 27, 2014

openSUSE 13.1 XEN setup

I have found creating XEN virtual machine on openSUSE 13.1 quite troublesome. The following procedure is quite painless though:

xl replaces xm.
Using the CLI is actually easier and smoother running than using YaST.

So, I found the following good:

Use Yast -> Network -> Network devices and switch to ifup
Then, Yast -> Virtualization -> Install Hypervisor tools -> Choose Xen -> create bridge (br0) as part of the install process.

Copy Windows 7 ISO file to e.g. /home/virt

Create the virtual HDD
dd if=/dev/zero of=/home/virt/windows7.img bs=1024k seek=10000 count=0
#This creates a 10Gb file.
 
Create a config file /home/virt/windows.cfg:
 
#
#
# WINDOWS 7 CONFIGURATIONS
#
#

builder= 'hvm'
vcpus = 4
memory = 2048

##### Disks
disk = [
'file:/home/virt/windows7.img,ioemu:hda,w',
'file:/home/virt/windows7.iso,ioemu:hdc:cdrom,r'
]

##### Hostname
name = 'windows7'

##### Networking
vif = ['type=ioemu,bridge=br0']

##### Behavior
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'

##### Monitoring

vnc=1   # Enable VNC

vncconsole=0# Don’t start vncviewer after “create” the domain

vncunused=0 # Don’t automatically assign unused port based on domain id

vncdisplay=0 # VNC Port Number to be added to “59”. e.g.:  vncdisplay=2  : port=5902 ,  vncdisplay=30 : port 5930

usbdevice = 'tablet'
##### Boot
#Boot from cd-rom(d) and then hdd(c)
boot='dc' 
 
 
Start installation with (as root):
>xl create windows.cfg
>vncviewer 127.0.0.1:5900

No comments: