Tag Archives: ubuntu

Oh noes! Kivy dependency installation has killed my graphics

If you are in the habit of blindly installing packages onto your personal machine while following installation instructions for some new shiny program, and that current shiny program is Kivy (1.9) and your version of xorg is a bit out of date, you may find a black screen the next time you boot.

This is due to the following kivy dependencies which have upgraded your xorg dependencies and broken xorg:


When you try and start xorg, you will get an error similar to:

No such file or directory: /usr/bin/x


To fix, upgrade xorg to quantal version:

apt-get install xserver-xorg-lts-quantal


I rebooted into failsafe graphics mode, then normal mode (both failed), then normal mode again and everything was working.

Adding mongo-10gen to apt-cacher (and Ubuntu)

On the server:

Add the following line to /etc/apt-cacher/apt-cacher.conf:
path_map = mongodb-10gen http://downloads-distro.mongodb.org/repo/ubuntu-upstart

Download the key and serve to clients (I rather add the key to the repo server and have clients download it from there, than connect out and get from the internet):
gpg –keyserver keyserver.ubuntu.com –recv-keys 7F0CEB10
gpg –armor –export 9958C967 > mongodb-10gen.pub
python -m SimpleHTTPServer 8000


On client:

Create file /etc/apt/sources.list.d/10gen.list with the following contents:
deb http://your.apt-cacher.hostname:3142/mongodb-10gen dist 10gen

Download key from repo server:
wget http://your.apt-cacher.hostname:8000/mongodb-10gen.pub
apt-key add mongodb-10gen.pub
apt-get update

That should do it.  Then you can stop the python web server on the repo server.

Virtualbox boot Ubuntu 12.04 into recovery mode

Put the Ubuntu ISO in the drive
When the VM starts up, press the ESC key to get into the install options screen
Press f6 to get the boot argument line to show (then ESC to hide the submenu)
Go down to boot from first hard disk, then type “boot=/casper single”
This should open up another menu, with the option to boot into recovery
And then you get another menu, choose to boot as root user
When you’re in the shell as root user, type: mount -o remount,rw /
Should now have read-write access to filesystem as root user

Notes on adding new HDD space to XenServer VM using ext3

Ubuntu, for example, will use ext3 by default.  And on XenServer, you can’t boot into gparted (I think it should be possible, but I can’t get it to work).
If your VM is using LVM (eg CentOS), do not do this, there is an easier way.

The following instructions will not delete any data if you have one /root partition with all the data on that you’re increasing, and so long as you start the new partition at the same place on the disk.

Rough instructions:

shut down the VM
backup the VM
using xenserver, add the extra space
boot into recovery mode (have the distro iso in the drive, and go to toolbar > VM > start/shutdown > start in recovery mode
in recovery mode, bring up a shell running from the recovery media (nothing mounted)
fdisk /dev/sda
p # print out the current partition table, take a note of the start of the root partition, the type codes of all partitions, and optionally the size of additional partitions
d # delete all partitions
set up the partitions again (for swap, first add two other partitions – in ubuntu this is sda1 primary and sda2 extended, then label 5 for swap will be available)
t # change type of partitions if necessary
wq # write the partitions

need to restart here?  go back to rescue mode if so

e2fsck -f /dev/sda1
resize2fs /dev/sda1
resize2fs /dev/sda5 (might need to do e2fsck first – try resize2fs and it may tell you to do e2fsck)
(don’t think you need to for /dev/sda2??)

restart the computer, not rescue mode

check fdisk -l shows the partitions

umount /dev/sda5
mkswap /dev/sda5
swapon /dev/sda5

blkid # get partition ids (should also have given you swap id when did mkswap command)
vi /etc/fstab # make sure swap partition is correct, like this:
  UUID=3ddbc973-d84c-4dad-ba09-473f46f72c32 none  swap    swap    sw      0     0
restart, not rescue mode

check swap mounted
free -m #should show swap with some space



Accessing a GUI on Ubuntu XenServer VM

If you try and start the GUI on a paravirtualized Ubuntu VM in XenServer, you’ll get the following error:

Primary device is not PCI
(EE) open /dev/fb0: No such file or directory
(EE) No devices detected

Peter Bats from Citrix said the following:
In a paravirtualized world there is no such thing as a physical console (nor is there a physical CPU, physical memory etc). Hence for completely paravirtualized OSes (with a paravirtualized kernel like Xen) there’s no GUI console.

PS: With the upcoming move/approach of something called PV on HVM (Paravirtualized Linux I/O drivers for a HVM machine, that in this was can profit from the latest developments by Intel/AMD at the hardware levels like EPT/NPT etc.) one will have the option to have both. And a hardware console GUI and good paravirtualized I/O.
This is already available for the RHEL/SLES distros, but not for the general Linux kernel or debian based distributions. There’s work underway to get this included into upstream Linux very soon.


In other words, use VNC for now.

To do that:

  1. Install a GUI onto your Ubuntu server:
    apt-get install ubuntu-desktop (for gnome)
    apt-get install –without-recommends ubuntu-desktop (for gnome without libreoffice and some other stuff)
    apt-get install xubuntu-desktop (xfce)
    apt-get install kubuntu-desktop (KDE)
  2. Install VNC
    apt-get install vnc4server
  3. Set the VNC resolution (whatever resolution you want to see on your desktop machine you’ll be using the VNC client on
    vncserver -geometry 1280×1024 -depth 24
  4. Create a password and VNC server should create some configuration files and start up
  5. Now we need to edit one of the configuration files
    vncserver -kill :1
    vim ~/.vnc/xstartup
  6. Change the file to look like the following (Ubuntu 10.04 and 10.10 only, other versions look different):

    # Uncomment the following two lines for normal desktop:
    exec sh /etc/X11/xinit/xinitrc

    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    x-terminal-emulator -geometry 1280×1024+10+10 -ls -title “$VNCDESKTOP Desktop” &
    x-window-manager &

  7. Save and quit vim
  8. Start up the VNC server again
    vncserver -geometry 1280×1024 -depth 24
  9. Now you can connect to the server via a VNC client.  On windows, you can use TightVNC
  10. To connect to the server, you want to use IP:1, for example, my server’s IP is, then I need to connect to
  11. Put in the VNC password when requested by TightVNC and it should bring up the server’s desktop




Setting up Ubuntu 10.04 using XenCenter 5.6 experimental Ubuntu template

After a while of getting errors while trying to install an Ubuntu ISO to a new Ubuntu template VM, I got it working using the following URL for the install from web:

UPDATE: this URL also works – http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/
(The path they’re looking for is /dists/lucid/main/installer-i386/current/images/netboot/xen/vmlinuz)

Not sure why, but all of the mirrors I found apart from this had the wrong folder structure, and XenCenter wanted to find the ISO itself a few folders deep, rather than let me give it the exact location of the ISO to install.


Installing XenServer Tools is also easy.  Put the tools into the virtual drive, mount it, navigate to it and into the Linux directory, pick your package (64 or 32 bit) and install:

mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
cd /media/cdrom/Linux
dpkg -i xe-guest-utilities_5.6.100-651_i386.deb