As part of my 2012 projects (see here plus an update here), I’ve been familiarizing myself with the Xen hypervisor. To that end, I’ve been working to get XCP (Xen Cloud Platform, the open source version of XenServer) running on a test system in my home office. It’s been a bit of a struggle, but I think I’ve finally got it, and I wanted to share the information here.
Here are the steps that I followed to install XCP-XAPI on a system running Ubuntu Server 12.04 LTS. Much of the credit goes to Project Kronos and this page in particular on the XCP toolstack on a Debian-based installation. While the XCP toolstack page is quite helpful, I found that the instructions were confusing (for me, at least). Hence, I’m writing up my steps in the hopes that they will prove useful to someone else.
Before Installing XCP-XAPI
Before I started the installation of the XCP-XAPI packages, I first made sure that all the various networking interfaces were configured correctly and working as expected. For my particular system (a Dell Latitude E6400), this meant installing some proprietary Broadcom wireless firmware (using the firmware-b43-lpphy-installer package) and configuring /etc/network/interfaces. I also ran apt-get update and apt-get upgrade to install the latest versions of all packages. Credit goes to this page for instructions on how to configure the wireless NIC from the CLI, with one small correction. In the /etc/network/interfaces file, I had to use this as the pre-up parameter (the example on the page above used “-Bw” instead of “-B”):
pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
(Naturally you’d write that all as one line; it’s broken here for readability.)
Installing XCP-XAPI
First, I edited /etc/apt/sources.list to add repositories for the XCP-XAPI packages. Although Ubuntu 12.04 LTS provides XCP-XAPI packages, the Project Kronos page indicated that there were dependency issues, so I went with these packages instead. If anyone has any experience with the Ubuntu-provided XCP-XAPI packages, please let me know.
I added these lines:
deb http://ppa.launchpad.net/ubuntu-xen-org/xcp-unstable/ubuntu precise main
deb-src http://ppa.launchpad.net/ubuntu-xen-org/xcp-unstable/ubuntu precise main
Then I ran this command:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9273A937
That was followed by:
apt-get update apt-get install xcp-xapi
From there, apt-get started fetching and installing the necessary packages (and there are quite a few). When prompted, I selected to use OpenvSwitch as the networking backend (instead of standard Linux bridging).
Before rebooting—which you’ll need to do in order to boot into the Xen kernel—I also performed the following steps.
- I edited the
/etc/init.d/xendfile to prevent xend from starting up. (Note that I deliberately split the two sed commands here for easier readability.)
-
I set the XAPI toolstack as the default by editing
/etc/default/xenand changing the lineTOOLSTACK=""toTOOLSTACK="xapi". -
I made the Xen kernel the default grub entry by editing
/etc/default/gruband settingGRUB_DEFAULT="Xen 4.1-amd64". Then I ranupdate-grub. -
I added a symbolic link from
/usr/share/qemu-linaro/keymapsto/usr/share/qemu/keymaps.
sed -i -e 's/xend_start$/#xend_start/' /etc/init.d/xend sed -i -e 's/xend_stop$/#xend_stop/' /etc/init.d/xend update-rc.d xendomains disable
At this point, the system is ready for a reboot.
Verifying that XCP-XAPI Works
I’m still working on a more comprehensive set of tests, but some basic tests should tell you whether the system is working or not:
- Run
xe host-list. It should return a single host, which is the system you just built. - Run
xe vm-list. The information returned should list a single VM described as the control domain on the host. - Run
xe network-list. You should get back a network for each network interface, plus another network for XenAPI communications. - Run
xe sr-list. You should get back a single SR (storage repository) used for XenServer Tools ISOs.
(By the way, note that xe requires a username and password, even if you’re running it against the local host. I found it easiest to create a password file and then create an alias for xe that included the -pwf parameter.)
I have future posts planned that will talk more about networking and SRs with this Ubuntu-based XCP-XAPI system, so stay tuned for those. Also, if you have any tips or tricks for making this process easier (or if I’ve stated something incorrectly), please speak up in the comments. Thanks!
Tags: Linux, Ubuntu, Virtualization, Xen
-
username / password is not needed if you’re using sudo
other tips:
xe vm-template list
xe host-list
xe sr-create host-uuid=… device-config:server= device-config:serverpath= device-config:type=nfs device-config:options=”-o proto=tcp” name-label=”" content-type=user type=nfs
xe sr-list
xe vm-install template=… new-name-label=… sr-uuid=…
xe vm-list
xe vm-param-set uuid=… other-config:install-repository=http://..
xe vm-start vm=… -
Hi Scott,
I followed your excellent tutorial and all went great, except for the administration via XenCenter: the virtual machine’s console is not accepting any keystrokes. Did you try to manage virtual machines with XenCenter? It occurs with every HVM VM, even with Ubuntu installation.
Thanks in advance.
-
Hi Fabio…
I ran into the same issue with my install. The solution (for the moment) appears to be to use vncviewer on a separate ubuntu machine using the -via argument to tunnel through ssh to the actual server and use the separate ubuntu machine’s xserver to display the screen. it works.
Now my issue is the whole networking stack is just weird. I’m trying to use openvswitch (since bridge just didn’t seem to be working at all), but it’s just not there at the moment. Not sure what i’m doing wrong, but i’m about ready to bail on the whole thing and try something different. (I have three 2950s that I need to configure in some sort of cloud configuration to be redundant and highly available running w2k3 and w2k8 web servers)
-
I’ve tried a very similar setup tutorial which can be found here:
http://www.chimos.de/stuff/xen-xcp-ubuntu-manual/xen-xcp-ubuntu-manual.txtxe host-list lists the host but when trying to connect using xencenter I get connection refused. Any ideas?
-
So, i’m *so* almost there with XCP-XAPI. i’ve followed most of the above and i’ve reached the point where I have it running, can create vms in xencenter, installed an OS in the vm (using a third machine to connect to the vncterm), but I just *cannot* for the life of me get openvswitch to work properly. xapi appears to add the vif and add the vif to the bridge (shows up in ovs-vsctl show)
Have you any ideas as to how to debug this?
-
Hi Scott,
I tried all your given instructions and finally tested after rebooting but I got an error “server internal error” when i run xe commands.
-
Hi Nandakumar,
Just got out your problem. The following should solve the issues with xe commandssed -i -e ‘s/xend_start$/#xend_start/’ /etc/init.d/xend
sed -i -e ‘s/xend_stop$/#xend_stop/’ /etc/init.d/xend
update-rc.d xendomains disable -
you could replace step 2 to 4 by simply doing:
apt-add-repository ppa:ubuntu-xen-org/xcp-unstable -
You could replace
“I added these lines:
deb http://ppa.launchpad.net/ubuntu-xen-org/xcp-unstable/ubuntu precise main
deb-src http://ppa.launchpad.net/ubuntu-xen-org/xcp-unstable/ubuntu precise mainThen I ran this command:
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 9273A937
”By apt-add-repository ppa:ubuntu-xen-org/xcp-unstable
-
Also i am getting error when I am trying this command
“apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 9273A937″
Error is : ?:keyserver.ubuntu.com:connection timeout
gpgkeys: HTTP fetch error 7: couldn’t connect: connection timed out
gpt: no valid OpenPGP data found.
gpg:no valid OpenPGP data found.
gpg: Total number processed:0 -
Hi All,
Thanks for your reply. I have tried deploying the same steps in another system, It was successful. After reading some articles in other forums i found the hardware am installing in it is not supporting.
That’s the reason the error occurs saying Memory insufficient.
Thanks,
Nanda -
Yes slowe that was network connectivity issue..Thanks
-
after i reboot after edit grub completely, my server have a reboot loop after booting in xen kernel.
i don’t know how to debug error because i can’t boot in xen kernel.
-
Anyone else run into this bug while trying to install the above ?
https://bugs.launchpad.net/ubuntu/+source/xen-api/+bug/1004028
Am scratching my head why none of you ran into it and I ran face first into it. Any help appreciated -
Great write up got me past the hurdle ( needed the other sources). If it helps anyone xapi is broke on ubuntu (stock). I am at the point of trying to get xencenter working. I have noticed that my new install is not listening on tcp http at all so either the server is not enabled or it does not work. My Xcp box always has thses going ( i do have a ssh going on this)
tcp 0 52 192.168.0.2:ssh mxdog-pc-n.mxdog.ne
tcp 0 0 localhost:57091 localhost:http
tcp 0 0 localhost:http localhost:55853
tcp 0 0 localhost:36735 localhost:5901and my fresh new install (thanks to this page)
tcp 0 52 mx-nas-01.mxdog.net:ssh mxdog-pc-n.mxdog.:55119
no listener …not sure how to fix that yet but thought i would post it
thanks again
-
just a follow up quick ..to get xencenter working stunnel needed to be enabled and the version had to be changed in xen inventory file . i just did 6.0.0 once stunnel was running https was showing and xencenter hooked right up
-
I was able to install XCP-XAPI onto Ubuntu Desktop. But upon attempting to log into XCP-XAPI from XenCenter using my username and password for my administrator account for Ubuntu, I received the following error:
“Incorrect username and/or password.”
I also tried to log into XCP-XAPI from XenCenter using “root” as my username and the corresponding password. Again, no luck.
After attempting a few other fixes to no avail, I finally enabled the super user account password on Ubuntu using the following:
$ sudo passwd root
[sudo] password for admin:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfullyAfter the above, I was able to log into XCP-XAPI from XenCenter using “root” as my username and the corresponding password.
QUESTIONS: Is the above (enabling super user password and logging in as root) typically necessary? Or is there a better approach?



19 comments
Comments feed for this article