Ubuntu

You are currently browsing articles tagged Ubuntu.

If you’ve been reading my site for any length of time, you know that I’ve been working with libvirt, the open source virtualization API, for a while. As part of my testing with libvirt, I’ve needed to stay on the “cutting edge” of libvirt’s development (so to speak), so I’ve been compiling my own version of libvirt from the source packages available from the libvirt HTTP server.

You can see some of the posts I’ve written about compiling libvirt:

Compiling libvirt 1.0.0 on Ubuntu 12.04 and 12.10
Compiling libvirt 0.10.1 on Ubuntu 12.04
Compiling libvirt 0.10.1 on CentOS 6.3

While these instructions work, there is an important consideration to keep in mind here: updating the system. When you compile and install your own binaries, the system has no way of knowing how to apply updates. For example, on Ubuntu, this means that apt-get, aptitude, and Update Manager are not aware that a newer version of libvirt is present on the system. Thus, when you go to update the system—you do keep your system updated, right?—then things will break. (Note that there are workarounds for apt-get and aptitude, but it does not appear that these workarounds also work with Update Manager.)

If you are considering following my instructions to compile your own binaries for libvirt, please be sure to keep this consideration in mind. This sort of “gotcha” might be fine for a small home-based lab like mine, but it probably isn’t the sort of issue you’d like to introduce into any sort of production (or quasi-production) environment.

Thanks to Theron Conrey for highlighting the significance of this concern. Be sure to check out Theron’s comment on this article for more information on a potential Ubuntu PPA that might help with this issue.

Tags: , , , ,

In case you hadn’t noticed late last week, the open source virtualization API project libvirt released version 1.0.0—a major milestone, obviously. To celebrate the 1.0.0 release, here are instructions for compiling the libvirt 1.0.0 release on Ubuntu 12.04 and 12.10.

(If you need instructions on compiling an earlier release of libvirt on Ubuntu, see this post. It works for libvirt 0.10.1 and 0.10.2 on Ubuntu 12.04 LTS; I haven’t yet tested it on Ubuntu 12.10.)

These instructions assume that you have built a plain-jane Ubuntu system (either 12.04 LTS or 12.10). I tested these instructions on an Ubuntu 12.04.1 LTS VM, freshly built and updated using apt-get update && apt-get upgrade, on a freshly-built Ubuntu 12.01 VM (also up to date), and a physical system running an up-to-date instance of Ubuntu 12.04.1 that also had KVM and an earlier version of libvirt installed. These instructions worked in all three cases.

Ready? Let’s get started!

  1. Download the libvirt-1.0.0.tar.gz tarball from the libvirt.org HTTP server.

  2. Extract the tarball using tar -xvzf libvirt-1.0.0.tar.gz.

  3. Using apt-get, ensure that the following packages are installed: gcc, make, pkg-config (already installed in my testing), libxml2-dev, libgnutls-dev, libdevmapper-dev, libcurl4-gnutls-dev, and python-dev. (Interestingly enough, earlier versions also required libyajl-dev, but this version didn’t seem to need it.) You can probably omit the libcurl4-gnutls-dev package if you don’t want ESX support; I did want ESX support, so I included it.

  4. From within the extracted libvirt-1.0.0 directory, run the configure command. I specified particular directories because that’s where the prebuilt binaries from Ubuntu are normally placed. I’ve line-wrapped it here for readability:

  5. ./configure --prefix=/usr --localstatedir=/var \
    --sysconfdir=/etc --with-esx=yes
  6. The above command does not include Xen support; if you need Xen support, you’ll need to add --with-xen=yes to the command, and your list of prerequisite packages will change (there are additional packages you’ll need to install).

  7. Once the configure command completes, then complete the process with make and make install. Note that I used sudo make install here because I’m installing files into privileged system locations.

  8. make
    sudo make install
  9. Finally, to verify that everything seems to be working as expected, restart libvirt with initctl stop libvirt-bin and initctl start libvirt-bin. (Yes, you could use initctl restart, but this allows you to see the clean stop and start of the libvirt daemon.) As an aside, note that this step only works if you either a) had a previous version of libvirt installed, or b) create the initctl job for libvirt. I chose the first approach.

  10. As a final verification step, run virsh --version or libvirtd --version to verify that you’re running libvirt 1.0.0.

That’s it! Now, as others have pointed out, this will create some potential system administration challenges, in that apt-get will still suggest new libvirt packages to install when you try to update the system. I think that there are some commands you can run to keep the manually compiled version instead of the version apt-get is suggesting, but I haven’t yet determined exactly which commands to use. (If you have more information, please speak up in the comments!)

I have a series of new libvirt-related blog posts in the works, so stay tuned for those. In the meantime, feel free to post any questions, corrections, or clarifications in the comments below. Courteous comments are always welcome.

Tags: , , , ,

Welcome to Technology Short Take #26! As you might already know, the Technology Short Takes are my irregularly-published collections of links, articles, thoughts, and (sometimes) rants. I hope you find something useful here!

Networking

  • Chris Colotti, as part of a changed focus in his role at VMware, has been working extensively with Nicira NVP. He’s had a couple of good posts; this one is a primer on how NVP works, and this one discusses the use of the Open vSwitch (OVS) vApp. As I mentioned before in other posts, OVS is popping up in more and more places—it might be a good idea to make sure you’re familiar with it.
  • This article by Ivan Pepelnjak on VXLAN termination on physical devices is over a year old, but still very applicable—especially considering Arista Networks recently announced their 7150S switch, which sports hardware VTEP (VXLAN Tunnel End Point) support (meaning that it can terminate VXLAN segments).
  • Brad Hedlund dives into Midokura Midonet in this post on L2-L4 network virtualization. It’s a good overview (thanks Brad!) and worth reading if you want to get up to speed on what Midokura is doing. (Oh, just as an aside: note that Midokura leverages OVS in their solution. Just saying…)
  • This blog post provides more useful information from Kamau Wanguhu on VXLAN and proxy ARP. Kamau also has an interesting post on network virtualization, although—to be honest—the post is long on messaging/positioning and short on technical information. I prefer the latter instead of the former.

Servers/Hardware

  • This mention of the Dell PowerEdge M I/O Aggregator looks interesting, although I’m still not real clear on exactly what it is or how it works. I guess this first article was a tease?

Security

Nothing this time around, but I’ll stay alert for items to include in future posts!

Cloud Computing/Cloud Management

  • Want to know a bit more about how to configure VXLAN inside VCD? Rawlinson Rivera has a nice write-up that is worth reviewing.
  • Clint Kitson, an EMC vSpecialist, talks about some VCD integrity scripts he created. Looks like some pretty cool stuff—great work, Clint!
  • For the past couple of weeks I’ve been (slowly) reading Kevin Jackson’s OpenStack Cloud Computing Cookbook; it’s very useful. It’s worth a read if you want to get up to speed on OpenStack; naturally, you can get it from Amazon.

Operating Systems/Applications

  • At the intersection of cloud-based storage and configuration management, I happened to find this very interesting Puppet module designed to fetch and update files from an S3 bucket. Through this module, you could store files in S3 instead of using Puppet’s built-in file server. (By the way, this module also works with OpenStack Swift as well.)
  • One of the things I’ve complained about regarding newer versions of OS X is the “hiding” of the Unix underpinnings. Perhaps I should read this book and see if my thinking is unfounded?

Storage

  • Chris Evans takes a look at Hyper-V 3.0′s Virtual Fibre Channel feature in this write-up. From what I’ve read, it sounds like Hyper-V’s NPIV implementation is more robust than VMware’s broken and busted NPIV implementation. (If you don’t know why I say that about VMware’s implementation, ask anyone who’s tried to use it.) The real question is this: is NPIV support in a hypervisor of any value any longer?
  • Gina Minks (formerly of Dell, now with Inktank) recommended I have a look at Ceph and mentioned this post on migrating to Ceph (with a little libvirt thrown in).
  • Gluster might be another project that I need to spend some time examining; this post on using Gluster with oVirt 3.1 looks interesting. Anyone have any pointers for a Gluster beginner?
  • Mirantis has a post about some Nova Volume integration with Isilon. I’ve often said that I think scale-out platforms like Isilon (among others) are an important foundation for future storage solutions. It’s cool to see some third-party development happening to integrate Isilon and OpenStack.

Virtualization

That’s all for this time around. As always, courteous comments are welcome (encouraged, in fact!), so feel free to speak up in the comments below. I’d love to hear your feedback.

Tags: , , , , , , , , , , , , , ,

I guess I’m a glutton for punishment, because after successfully compiling libvirt 0.10.1 on CentOS 6.3, I came back to try it again on Ubuntu (my first attempt was not successful). Here is the process I followed to get libvirt 0.10.1 compiled and running on Ubuntu 12.04.

I started with a clean install of Ubuntu 12.04, then installed KVM and Open vSwitch per these instructions. At the end of those instructions, I had an Ubuntu Server 12.04.1 system running KVM and libvirt 0.9.8.

Once I verified the system was working as expected (I ran a few virsh commands to check for errors), I followed these steps:

  1. As with the CentOS effort, I first downloaded the tarball for libvirt 0.10.1 from the libvirt.org HTTP server.

  2. Next, I extracted the files using this command:

  3. gunzip -c libvirt-0.10.1.tar.gz | tar xvf -
  4. Using apt-get, I installed the following packages: libxml2-dev, libgnutls-dev, libyajl-dev, libnl-dev, pkg-config, libdevmapper-dev, libcurl4-gnutls-dev, and python-dev. (Note that you can omit the libcurl4-gnutls-dev package if you don’t want ESX support in libvirt.) Just like with the CentOS procedure, I determined the necessary list of packages by repeatedly running the configure command.

  5. With all the dependencies now satisfied, I ran the configure command from the extracted libvirt-0.10.1 directory. I specified particular directories because that matched where the existing binaries were on the system (there’s probably an easier way). I’ve line-wrapped the command here for readability:

  6. ./configure --prefix=/usr --localstatedir=/var \
    --sysconfdir=/etc --with-esx=yes
  7. The above command results in a libvirt that supports KVM, OpenVZ, LXC, etc., including ESX. You’d have to add the --with-xen parameter to the configure command to include support for Xen; that might also change the list of dependencies that need to be installed first.

  8. After the configure command completed successfully, it was very straightforward:

  9. make
    make install
  10. Finally, I restarted libvirtd with initctl stop libvirt-bin and initctl start libvirt-bin. I probably could have used initctl restart, but I wanted to see the shutdown and startup separately. In this case, the libvirt daemon shutdown and started back up cleanly and without any errors.

From there, I was able to run libvirtd --version or virsh --version to verify that the system was, in fact, running libvirt 0.10.1.

The one big difference between this effort and the CentOS effort earlier was that Open vSwitch was installed and working on this system, so I ran ovs-vsctl show to double-check the OVS configuration and operation. I noted that the system had re-created the default bridge, so I got rid of that with these two commands:

virsh net-destroy default
virsh net-autostart --disable default

That removed virbr0 from the OVS configuration, leaving only the OVS bridge that I created during the KVM+Open vSwitch installation earlier.

Now that my test system has both OVS and a version of libvirt that supports OVS, the next steps will be to conduct some more in-depth libvirt+OVS tests and document the results. Stay tuned!

Tags: , , ,

As you may already know, my new role at EMC has me spending more time on open source projects like KVM, OpenStack, and others. Over the past few days, I’ve been working with KVM for a bit, and I wanted to share a few things I’ve learned along the way. Readers who are very familiar with KVM won’t likely find anything new here (although I do encourage you to share any additional information or insight in the comments).

The information presented here is based on working with KVM using libvirt. For those unfamiliar with libvirt, it is an open source framework/API that can help manage multiple hypervisors and virtual machines. If you use a different management layer—such as oVirt—then things might look a bit different, so keep that in mind. (My use of libvirt vs. oVirt is not an endorsement one way or another; I just happened to start with libvirt.) Also, I’m only focusing on command-line tools here; there are a number of graphical user interfaces (GUIs) available as well, which I may investigate further at some point in the future.

The Components of a KVM Guest

Let’s start with looking at the different components of a KVM guest. If you are familiar with VMware virtualization, you know that a VMware-based VM has essentially two components:

  • The VM definition, stored in a .VMX file
  • The VM’s storage, typically stored in one or more .VMDK files

From what I’ve been able to determine so far, KVM guests also have essentially two components:

  • The VM definition, defined in XML format
  • The VM’s storage, stored either as a volume managed by an LVM or as a file stored in a file system

You can look at the XML configuration of a KVM guest (more properly referred to as a domain) in a couple of different ways. Both involve the use of virsh, the command-line tool that is part of libvirt:

  • To edit the configuration of a guest, use virsh edit <Name of guest VM> and the system will open the XML configuration in your default editor.
  • To export the configuration of a guest, use virsh dumpxml <Name of guest VM>. This dumps the XML configuration to STDOUT; you can redirect the output to a file if you like.

Here’s a snippet of the XML configuration for a KVM guest:

...
    <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/vm01.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
...

The second component of a KVM guest is the storage; as I mentioned earlier, this can be a file on a file system or it can be a volume managed by a logical volume manager (LVM). The XML snippet above shows the configuration for a disk image stored as a file on a file system. This particular disk image is in QEMU raw format.

With that (very brief) overview complete, here is how you perform some common tasks with KVM guests.

Creating a KVM Guest

There are a couple of different ways to create a KVM guest:

  • Manually create the XML definition of the guest, then use virsh define <Name of XML file> to import the definition. You could, naturally, create a new XML definition based on an existing definition and just change a few parameters.
  • Use a libvirt-compatible tool, like virt-install, to create the guest definition.

Here’s a quick example of creating a KVM guest using virt-install (I’ve inserted backslashes and line breaks for readability):

virt-install --name vmname --ram 1024 --vcpus=1 \
--disk path=/var/lib/libvirt/images/vmname.img,size=20 \
--network bridge=br0 \
--cdrom /var/lib/libvirt/images/os-install.iso \
--graphics vnc --noautoconsole --hvm \
--os-variant win2k3

This command creates a KVM guest named “vmname”, with 1024 MB of RAM, a single vCPU, a 20 GB virtual disk (in the default QEMU raw format, thin provisioned so that not all 20 GB are allocated up front), connected to an OS installation ISO at the path specified and using hardware virtualization. The network connection is to a bridge called br0, which might be a fake bridge on Open vSwitch (which in my case it is). Access to the console is handled via VNC.

Full details on the various parameters for virt-install are available via the man page (or you can look here).

Starting and Stopping KVM Guests

This one is easy:

  • To start a VM, just run virsh start <Name of guest VM> and you’re off to the races.
  • To stop a VM, run virsh shutdown <Name of guest VM> and the guest will start an orderly shutdown. (BTW, I know that the orderly shutdown works for Ubuntu and Windows guests, but I haven’t figured out the exact mechanism yet. Any insight there?)

Changing Guest Configuration

If the VM is shut down, you can use the virsh edit <Name of guest VM> command to edit the XML definition directly.

If the VM is running, then only certain things can be done. You are supposed to be able to swap floppy or CD/DVD images using the virsh qemu-monitor-command command. In practice I found that it ejected CD/DVD images fine, but wouldn’t load a new CD/DVD ISO image. I’m still working on a fix for that one (tips are welcome).

Using Paravirtualized Drivers

For improved performance, you can also use paravirtualized drivers. (This is the equivalent of using VMXNET3 or PVSCSI in a VMware world.) So far I’ve only tested the network drivers on Ubuntu and Windows, but they seem to work just fine. (These paravirtualized drivers are referred to as the virtio drivers.)

To use virtio drivers for networking, edit the guest configuration like this:

<interface type='bridge'>
  <mac address='52:54:00:a0:55:ef'/>
  <source bridge='br0'/>
  <model type='virtio'/> (add this line)
</interface>

I found this page to be quite helpful in determining exactly how to enable the virtio network drivers. This part is the same for both Ubuntu and Windows guests; for Windows guests, you also have to install the virtio drivers into Windows. That can be a bit more problematic; I’d recommend copying them across the network before making the change above.

This change must be made while the guest is shut down, by the way.

Cold Migrations of KVM Guests

You can probably figure out how this one works by now:

  1. Shut down the guest using virsh shutdown <Name of guest VM>.
  2. Export the XML configuration using virsh dumpxml <Name of guest VM> > <Name of XML file>.
  3. Copy the XML definition you just created and the guest’s disk image (specified in the XML configuration) to the target node.
  4. Edit the XML configuration (as needed) to reflect any changes in paths.
  5. Define the guest on the new node using virsh define <Name of XML file>.

Obviously, this assumes an image-based disk, not a LVM-backed disk.

While hardly a comprehensive list of all the various operations that might need to be done with a KVM guest, hopefully this will at least get you started. I’ll post more as I learn more, and readers are encouraged to share tips, tricks, or other information in the comments below.

Tags: , , ,

This is the first of a number of posts in which I’ll be discussing Ubuntu Linux, KVM, and the Open vSwitch (OVS). I hope that you find the posts helpful.

Let me start this post by providing this disclaimer: I’m still very early in the learning curve with KVM and OVS, so I can’t promise you that this post will be absolutely perfect. It is, however, a pretty decent starting point. I’ve gone through this process several times, and there is only one sticking point that I haven’t yet resolved (which I’ll describe later on).

I’m going to assume that you are reasonably familiar with Ubuntu, as that’s the platform I’m using for all my testing (specifically, Ubuntu Server 12.04 LTS with a 64-bit kernel). I’m also assuming that you are prefacing all these commands with sudo or that you’ve attained root privileges via the method of your choice.

We’ll start this process by ensuring that our Ubuntu installation is up-to-date:

# apt-get update && apt-get dist-upgrade

In my case, this brought me up to Ubuntu 12.04.1, running the 3.2.0-29 kernel.

Next, we’ll install KVM and a couple associated packages:

# apt-get install kvm libvirt-bin virtinst

This command will install KVM, libvirt, a couple of command-line utilities, and a whole bunch of other required packages.

Next, to prepare the system for the installation of OVS, we’ll remove the default libvirt bridge (named virbr0). This ensures that the bridge compatibility portion of OVS can load without any potential conflicts:

# virsh net-destroy default
# virsh net-autostart --disable default

At this point, because we aren’t using the default Linux bridge, we can remove the ebtables package using the following command. (Note: I am not 100% sure that this step is necessary, but almost all of the guides I followed included this step. If anyone has more information, please let me know in the comments.)

# aptitude purge ebtables

You’re now ready to install OVS (this should be all on one line; I’ve added a line breaks—noted by a backslash—for readability):

# apt-get install openvswitch-controller openvswitch-brcompat \
openvswitch-switch openvswitch-datapath-source

This command installs the various OVS components and—as with KVM—a large number of required packages. Depending on the speed of your Internet connection, you might want to go get a cup of coffee.

Once the OVS packages are installed, we’ll need to enable bridge compatibility mode for OVS. To enable bridge compatibility mode, edit /etc/default/openvswitch-switch and change this line:

#BRCOMPAT=no

Change it by removing the hash mark (uncommenting it) and specifying yes, like this:

BRCOMPAT=yes

At this point, you can try starting OVS with service openvswitch-switch start, but you might get an error about a module being in the wrong format or not built for your kernel. If you removed the default libvirt bridge (virbr0) using the virsh commands earlier, then you should be OK, but if you get an error about the module being in the wrong format go ahead and run this command to build and install the necessary module:

# module-assistant auto-install openvswitch-datapath

Once this process finishes, let’s go ahead and reboot. After the system reboots and comes back up, check the status of KVM and OVS with the following commands.

To check KVM, use this command:

# virsh -c qemu:///system list

This will return a list of running VMs (which is probably empty on your system).

To check OVS, first use this command to see if the kernel modules loaded properly:

# lsmod | grep brcom

This should return an entry containing brcompat_mod and openvswitch_mod. Follow that with this command:

service openvswitch-switch status

The output should show several OVS processes in the running state.

Assuming that everything is working properly, you should now be able to run ovs-vsctl show and get a very simple response that basically indicates that OVS has no configuration.

We are now nearing the end; only a couple of steps remain. The last thing we need to do is create an OVS bridge that will allow KVM guests to communicate with the outside world. This is a two-step process. The first step is to use ovs-vsctl to create a bridge and add at least one physical interface:

# ovs-vsctl add-br br0
# ovs-vsctl add-port br0 eth0

Obviously, you’ll want to substitute the correct physical interface for eth0 in the commands above. After running these commands, then running ovs-vsctl show will return something like this:

bc12c8d2-6900-42dd-9c1c-30e8ecb99a1b
    Bridge "br0"
        Port "eth0"
            Interface "eth0"
        Port "br0"
            Interface "br0"
                type: internal
    ovs_version: "1.4.0+build0"

The final step is to edit /etc/network/interfaces so that the bridge comes up automatically. This is where I ran into problems. No matter what I tried, I could get the bridge to come up, but the physical interface attached to the bridge would not come up automatically. I could easily manually bring it up (using ifconfig eth0 up), but it wouldn’t come up automatically on boot. If anyone has any ideas, I’m open to them.

In any case, here’s the /etc/network/interfaces that I used (IP addresses and domain names have been changed to protect the innocent):

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

# The OVS bridge interface
auto br0
iface br0 inet static
address 192.168.1.200
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
dns-search mydomain.local
dns-nameservers 192.168.1.1 192.168.1.2

I tried several different variations for eth0, but none of them would bring the interface up automatically when I boot the system. Everything else seems to work just fine, so I’ve settled with manually bringing the interface up after a reboot until I figure out how to fix it. Suggestions are welcome.

In a future post (very soon), I’ll be talking more about OVS and what it looks like when you boot up KVM guests on OVS, so stay tuned for that.

As always, thoughts, corrections, questions, and clarifications are welcome—just speak up in the comments below. Thanks!

Tags: , , , , ,

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.

  1. I edited the /etc/init.d/xend file to prevent xend from starting up. (Note that I deliberately split the two sed commands here for easier readability.)
     
  2. 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
  3. I set the XAPI toolstack as the default by editing /etc/default/xen and changing the line TOOLSTACK="" to TOOLSTACK="xapi".

  4. I made the Xen kernel the default grub entry by editing /etc/default/grub and setting GRUB_DEFAULT="Xen 4.1-amd64". Then I ran update-grub.

  5. I added a symbolic link from /usr/share/qemu-linaro/keymaps to /usr/share/qemu/keymaps.

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:

  1. Run xe host-list. It should return a single host, which is the system you just built.
  2. Run xe vm-list. The information returned should list a single VM described as the control domain on the host.
  3. Run xe network-list. You should get back a network for each network interface, plus another network for XenAPI communications.
  4. 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: , , ,

If you were following my tweets over the last few days, you probably already know that I have been working on setting up a CCNA study environment using Ubuntu Linux, GNS3, and VMware Workstation. After a couple days of difficulties, I finally managed to make it work last night. Here are the steps that I took to make it work.

Before we start, there is the standard disclaimer: these are the steps that worked for me; these steps might or might not work for you, and are almost guaranteed not to work with different Linux distributions or different versions of the associated software.

Here are the software components and versions that I am using in my environment:

  • Ubuntu Linux 8.04.4 LTS, 32 bit
  • GNS3 0.6.1
  • Dynamips 0.2.8-RC2
  • Dynagen 0.10.1.090807
  • VMware Workstation 7.0.1 for Linux, 32 bit

I won’t go into great detail on setting up Ubuntu Linux as there are plenty of resources available for that portion of this environment. You will need to be at least vaguely familiar with the Linux command-line interface (CLI) and basic Linux commands, or you’ll find this process a bit difficult.

Once you have Ubuntu Linux installed and configured appropriately, the first step is to go ahead and install some dependencies using apt-get:

sudo apt-get install dynagen python-qt4

This should download and install both Dynagen and the Python-QT4 libraries. Next, you’ll need to download and install GNS3 0.6.1. There are newer versions of GNS3 available, but earlier attempts to get this environment running with the newer version of GNS3 resulted in problems. Again, your results might differ. Version 0.6.1 of GNS3 is available from the GNS3 SourceForge site.

Once you have GNS3 downloaded, extract it into the directory of your choice (I chose to use /opt/GNS3).

After you’ve downloaded and extracted GNS3, create the following directories under the directory where GNS3 is found:

<GNS3 directory>/project
<GNS3 directory>/ios
<GNS3 directory>/cache
<GNS3 directory>/tmp
<GNS3 directory>/dynamips

Use the chmod and chown commands as necessary to ensure that your user account has full read/write permissions all of these directories except the dynamips directory.

Download a copy of Dynamips (it’s generally available here), put it into the dynamips directory you created, and use the chmod command to make it executable. I also found it necessary to set the Dynamips binary’s SUID bit so that it would always run as root; I know this is not best practice but I could not find any other workaround. (Without setting it SUID, GNS3 would always report an error when trying to launch Dynamips.)

Now launch GNS3 and use the Preferences in the application to set the correct path to your project directory (<GNS3 directory>/project) and the IOS/PIX directory (<GNS3 directory>/ios), the correct path to the Dynamips binary (<GNS3 directory>/dynamips), the correct path to the working directory (<GNS3 directory>/tmp), and the working directory for capture files (set it to your project directory).

At this point you should have a working GNS3 installation. You’ll still need to locate IOS images to use; once you have valid IOS images, place them in the ios directory you created earlier and configure them within GNS3 as needed. You should then be able to create a router instance, boot it, and access the router console from within GNS3.

You could stop there and have a pretty cool environment, but I wanted to go a step further. I also installed VMware Workstation 7.0.1 (I won’t go into detail here, it’s a pretty simple process) and then used the Virtual Network Editor to create some additional host-only networks (in addition to the default vmnet1). Again, this is well-documented already, so I won’t discuss the process in any length. Where it gets interesting is in how you connect GNS3 and these host-only networks so that VMs can be incorporated into your GNS3 router topology.

Here’s how you connect GNS3 and the VMware Workstation host-only networks:

  1. In GNS3, add a cloud object to the topology.
  2. Right-click the cloud object and select Configure.
  3. On the NIO Ethernet tab in the Generic Ethernet NIO section, select one of the host-only networks (like vmnet1) and click Add. This creates a link between the cloud object and the selected host-only network.

At this point, you can attach a VM to the selected host-only network, attach a router to the cloud, and be able to pass traffic from the VM to the router. Pretty cool, huh?

What I’ve done so far is create a simple network with two VMs attached to two different host-only networks which are in turn connected to two different cloud objects and two different routers. Then I created a “serial WAN link” between the two routers (GNS3 won’t, as far as I can tell, actually simulate WAN links with bandwidth limits and latency) and configured everything so that I could pass traffic from one VM to the second VM across the “virtual WAN”. The plan is to increase the network complexity—as much as my poor little Dell laptop will allow given its limited CPU and RAM—and work through the various CCNA study guides in preparation for my exam.

One other quick note about this setup (and the reason why I chose Linux as my host platform): by setting up SSH on the Linux system (with a simple sudo apt-get install openssh-server), I can now SSH into the Linux host system and then use Telnet from there to access all the various routers. In addition, because I’m using OpenBSD as the guest OS on my VMs, I can also SSH from the Linux host to the OpenBSD VMs (assuming my GNS3 network is configured correctly). I’m also thinking that there’s a way I can leverage some VNC connectivity through Workstation to access the VMs as well, but I’ll need to research that a bit to see how it works.

I would be remiss if I did not point out a couple of sites that were extremely helpful in getting this setup up and running. First, this site provided an excellent overview of the GNS3 installation on Ubuntu. Although the walk-through was for a newer version of Ubuntu, the instructions worked perfectly on 8.04.4 LTS. Second, this site gave me the “missing link” on how to connect GNS3 and VMware Workstation’s host-only networks so that you could mix the two environments. Thank you to both sites for outstanding information!

If you are a GNS3 expert or have some additional tips or tricks to share, please add them in the comments below so that all readers can benefit. Courteous comments are always welcome.

Tags: , , , , , , ,

Over the 2008-2009 holiday season, I rebuilt my home network. I included the notes and information from my home network rebuild in an article that described the Mac OS X-Ubuntu integration resulting from the rebuild. Since that time, I’ve added a larger hard drive to the home server to make more room for Time Machine backups, movies, music, and other files. Things seemed to be working very well. Until the other day…

My wife made an offhand comment that she couldn’t access the shared music library from her laptop. I tested the connection and, sure enough, every time I clicked the shared library icon it simply disappeared. No error, no warning, no entries in any log files…it just disappeared. I searched the Windows event logs, and I searched the log files on the Ubuntu server downstairs. Neither computer had any entries whatsoever that provided any insight as to why this one computer would not connect to the shared music library.

Being the geeky troubleshooter that I am, I attempted to replicate the problem on some of the other computers on the network. My MacBook Pro worked fine. Three other Windows laptops on the network, running the same version of Windows (Windows XP Professional) and the same Service Pack revision, also worked fine. The problem seemed to be isolated to her computer. Perhaps it was only when she was on the wireless network…nope, the same problem regardless of the network connection.

I upgraded iTunes to the latest version. That didn’t work. I disabled the Windows Firewall on her computer. That didn’t work. I made sure that no traffic was being blocked by the firewall on the Ubuntu server; no traffic was being blocked. In other words, that didn’t work. I was about to give up and just write it off as one of those strange aberrations that couldn’t be resolved and chalk it up to Windows.

Then I stumbled onto this site. I’d already created a daapd.service file for Avahi to use previously, but this site described some additional entries in the daapd.service file that I didn’t have. I made some edits, based on the information on the site, and here’s the daapd.service file I had for Avahi:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Home Media Server</name>
<service>
<type>_daap._tcp</type>
<port>3689</port>
<txt-record>txtvers=1</txt-record>
<txt-record>iTSh Version=131073</txt-record>
<txt-record>Version=196610</txt-record>
</service>
</service-group>

After changing the daapd.service file to the version listed above, I restarted Avahi. Upon the shared media server re-appearing in iTunes, I clicked on it and…drum roll please…it worked! The previous version I had been using did not have the txt-record entries, and I really have no idea why adding the txt-record entries suddenly made my wife’s iTunes connect properly. I suppose it doesn’t matter why it works, it just matters that I FIXED IT! (ePlus engineers who attended our NSM this year will get this joke.)

Still, in the event you’re running into the same issue—a Windows installation of iTunes that fails to connect to a shared music library running on Firefly Media Server—then perhaps updating your Avahi configuration will correct the problem.

Tags: , , , , , ,

Apparently my Ubuntu-Mac integration article is quite popular; it’s been picked up for re-publication on a couple of different sites:

http://linux.sys-con.com/node/803618
http://opensource.sys-con.com/node/803618

Cool! I hope the article is useful to others.

As a quick follow-up to that article, you may recall that I ran into a strange issue with OpenVPN and mt-daapd prior to the home network rebuild. I just finished installing OpenVPN last night and, anticipating the problem, did some digging to see how I’d fix the problem this time around. Turns out there’s nothing to worry about; Avahi skips point-to-point interfaces by default, and OpenVPN tags its interfaces as point-to-point. So, everything works as expected.

Tags: , , , ,

« Older entries