Running X on your UML and connecting to it via VNC
In some cases it is desirable to have X on the virtual machines and connect
to them remotely. Ths quick howto shows how to end up with a running KDE
setup on your uml and how to connect to it via a VNC client. This is
desireable in cases where one needs to use graphical tools or wants create
problems for students wich adress administration tools like yast2.
First of all, this howto assumes a bridge setup on the host with the socket
placed in
/tmp/my-global. You may set it up differently, but this
may affect how accessible the host is from the outside.
MLN project file
The file of the project looks like this:
global {
project xhost
}
host bubba {
template sarge-thick.ext2
memory 128M
free_space 1000M
term screen
network eth0 {
switch /tmp/my-global
address dhcp
}
}
The setup is uncomplicated, but i have assigned 128M of ram. My host is a
P4 2.8 MHz with 2GB of ram and a regular SATA disk. I have also followed the
performance
tips. The project is buildt the following way:
mln build -f xhost.mln
I start the project and connect to the host:
mln start -p xhost
screen -r bubba
Installing KDE
Once connected, i add another user (i could have done it in the mln file,
but forgot). KDE is not installed on this template and so i need to install
it and a vnc server needs to be installed too:
adduser kyrre
apt-get update
apt-get install kde
apt-get install install xfonts-base xfonts-100dpi
apt-get install tightvncserver
This is done as root on the vm. What i do next is to ssh into the vm as the
regular user i just created and do the rest from there:
Starting vnc server
kyrre@bubba:~$ tightvncserver -geometry 1024x768
This setup asks you some questions, most importantly about the password of
the session. What i found out, was that the default setup did not start KDE
like I wanted, so i killed the vnc server and edited the startup file:
tightvncserver -kill :1
I edited the file
.vnc/xstartup to this:
#!/bin/sh
startkde &
The vnc server is started again and final step is to use some VNC client on any other machine and
use KDE. I found the performance to be impressive and could surf without any
problems using firefox on the vm.