Install Ubuntu Hardy PV DomU & VNC at Ubuntu Hardy Dom0 (all 64-bit)
This posting deals with utilizing same image device for loading HVM and PV
Ubuntu Hardy DomUs at Ubuntu Hardy Dom0 (2.6.24-21-xen #1 SMP Mon Aug 25 18:56:44 UTC 2008 x86_64 GNU/Linux). This approach allows to avoid traditional "debootstrap" procedure as well as taking a long time "apt-get install ubuntu_desktop", what is, actually, 400 MB download. It also provides a workaround to get Gnome Desktop working stable at Ubuntu PV DomU no matter on Xen Release (>=3.1.2) and OS (Solaris,Linux) running at Dom0.
Install Ubuntu Hardy HVM DomU via hvm-profile:-
root@boris-desktop:/etc/xen/vm# cat u8.cfg
kernel = "/usr/lib/xen/boot/hvmloader"
builder = 'hvm'
memory = 2048
name = "U8HVM"
vcpus = 1
vif = [ 'type=ioemu, bridge=eth0' ]
disk = [ 'phy:/dev/sda9,hda,w!','phy:/dev/loop0,hdc:cdrom,r' ]
device_model = '/usr/lib/xen/bin/qemu-dm'
vnc=1
boot='d'
**********************************
Ligin to HVM DomU and run :-
**********************************
# apt-get install linux-image-xen
# apt-get install vim
********************************************
Add one more entry to /boot/grub/menu.lst
*********************************************
default 0
# hidemenu
timeout 10
title Ubuntu 8.04.1, kernel 2.6.24-21-xen
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-21-xen root=UUID=d60fdbd1-29a5-452e-81b8-20af8423cb33 ro
initrd /boot/initrd.img-2.6.24-21-xen
title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=d60fdbd1-29a5-452e-81b8-20af8423cb33 ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet
. . . . . .
:wq
Add a console on xvc0:
# sed -e ’s/tty1/xvc0/’ /etc/event.d/tty1 | tee /etc/event.d/xvc0
Shutdown HVM DomU.
Create Ubuntu PV DomU profile at Dom0, referencing same image file as Ubuntu HVM DomU:-
bash-3.2# cat u8.cfg
memory = 2048
name = “U8PV”
vif = [ 'mac=00:16:3e:00:00:00' ]
disk [ 'phy:/dev/sda9,xvda,w!']
****************
Start PV DomU
****************
# xm create -c ub8.cfg
Make sure we are running PV DomU
root@boris-desktop:/etc/xen/vm# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 5980 2 r----- 938.4
U8PV 4 2048 1 -b---- 169.4
root@boris-desktop:/etc/xen/vm# xm list -l U8PV
(domain
(domid 4)
(on_crash restart)
(uuid eee633cc-233b-c50e-b84a-5743efcd6bd4)
(bootloader_args )
(vcpus 1)
(name U8PV)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 2048)
(memory 2048)
(shadow_memory 0)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(start_time 1224927678.38)
(cpu_time 169.670418175)
(online_vcpus 1)
(image
(linux
(kernel )
(notes
(FEATURES
'writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel'
)
(VIRT_BASE 18446744071562067968)
(GUEST_VERSION 2.6)
(PADDR_OFFSET 18446744071562067968)
(GUEST_OS linux)
(HYPERCALL_PAGE 18446744071564197888)
(LOADER generic)
(SUSPEND_CANCEL 1)
(ENTRY 18446744071564165120)
(XEN_VERSION xen-3.0)
)
)
)
(status 2)
(state -b----)
(store_mfn 2209411)
(console_mfn 2209410)
(device
(vif
(mac 00:16:3e:00:00:00)
(script vif-bridge)
(uuid 1494046f-11ad-f2b0-c2b2-01d485de8997)
(backend 0)
)
)
(device
(vbd
(uname phy:/dev/sda9)
(uuid 635d0e9c-2444-c7f6-f267-42c41e576a9c)
(mode 'w!')
(dev xvda:disk)
(backend 0)
(bootable 1)
)
)
(device
(console
(protocol vt100)
(location 2)
(uuid 89afbfc9-9248-5566-901d-288ccdbe24ec)
)
)
)
*********************************
When logged in as root run :-
*********************************
# apt-get remove network-manager
# vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
:wq
*****************************************************************
Obtain IP address for PV DomU without network-manager
*****************************************************************
root@boris-desktop:~# /etc/init.d/networking restart
* Reconfiguring network interfaces... There is already a pid file /var/run/dhclient.eth0.pid with pid 0
Internet Systems Consortium DHCP Client V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Listening on LPF/eth0/00:16:3e:00:00:00
Sending on LPF/eth0/00:16:3e:00:00:00
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 17
DHCPOFFER of 192.168.1.60 from 192.168.1.1
DHCPREQUEST of 192.168.1.60 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.60 from 192.168.1.1
bound to 192.168.1.60 -- renewal in 111610 seconds.
********************************************
Setup VNC at Ubuntu Hardy PV DomU
********************************************
# apt-get install vnc4server xinetd
# vi /etc/gdm/gdm.conf
Uncomment this line
RemoteGreeter=/usr/lib/gdm/gdmlogin
Enable xdmcp, look for [xdmcp] and change Enable to true.
[xdmcp]
Enable=true
************
Restart gdm
************
# /etc/init.d/gdm restart
Setup xinetd
************************************
Create a new service file for xinetd
************************************
# vi /etc/xinetd.d/Xvnc
service Xvnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -geometry 1024×768 -depth 16 -cc 3 -once -SecurityTypes=none -extension XFIXES
port = 5901
}
**************
Restart xinetd
**************
# /etc/init.d/xinetd restart
When connect via vncviewer from Dom0, getting Error Window “Gnome Setting Daemon failed to start”. To fix Gnome Setting Daemon failures to start, open vnc session with DomU ([2]) and run in gnome terminal ([3]):-
$ gconf-editor
and disable mouse and keyboard plugins.
Relogin to Ubuntu PV DomU via vncviewer.
Gnome Desktop should be working fine.
References.
1.http://blog.bashton.com/2008/running-an-ubuntu-hardy-xen-domu-under-a-centos-dom0/
2.http://lxer.com/module/newswire/view/110161/index.html
3.https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/199245