HOWTO: xen tools within FreeBSD domU

Janne Snabb snabb at
Sun Jan 30 12:56:35 UTC 2011

I wanted to look at xenstore contents from my domU. domU does not
have access to all data but the entries related to the domU instance
in question are available. I am posting this in case it happens to
be useful to someone else. It would be easy to make a xenstore-clients
or xen-tools-domU port.

Here is how to get a working "xenstore-ls" command and other xen
tools for your FreeBSD domU:

Building & installation

Prerequisites: gmake, XENHVM or XEN kernel (GENERIC will not work)

1. ftp

2. tar xvfz xen-4.0.1.tar.gz

3. cd xen-4.0.1/tools

4. gmake -C include

5. cd misc

6. gmake xen-detect

7. install xen-detect /usr/local/bin

8. cd ../xenstore

9. Build client library and programs:
  gmake clients

10. Install client library and programs:
  install /usr/local/lib
  install xenstore xenstore-control /usr/local/bin
  cd /usr/local/bin
  ln xenstore xenstore-chmod
  ln xenstore xenstore-exists
  ln xenstore xenstore-list
  ln xenstore xenstore-ls
  ln xenstore xenstore-read
  ln xenstore xenstore-rm
  ln xenstore xenstore-write


1. Set required environment variable:
  export XENSTORED_PATH=/dev/xen/xenstore

(Alternatively you could patch tools/xenstore/xs_lib.c function
xs_domain_dev() before compiling.)

2. Now you can do things such as:
  xenstore-ls device
  xenstore-ls -f /local/domain/0/backend/vif/11/0
  xenstore-read name

Best Regards,
Janne Snabb / EPIPE Communications
snabb at -

More information about the freebsd-xen mailing list