HOWTO: Xen tools within FreeBSD domU ==================================== Last updated: 2011-01-31 Author: Janne Snabb I wanted to look at xenstore contents from my domU. The domU does not have access to all data but the entries related to the domU instance itself are mostly available. The tools are useful for debugging Xen related problems when one does not have access to the dom0 or wants to view the entries from domU's perspective. xen-tools-domU port is being worked on at the time of this writing. Here is how to get a working "xenstore-ls" command and other Xen tools for your FreeBSD domU. Prerequisites ------------- For building the software you need: python, gmake xenstore tools run depedencies: XENHVM or XEN kernel (GENERIC will not work) xen-detect run depedencies: none (works with GENERIC also) Building & installation ----------------------- 1. ftp http://bits.xensource.com/oss-xen/release/4.0.1/xen-4.0.1.tar.gz 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 8.5: Consider applying a patch as follows, it will make your life easier later: ftp http://docs.freebsd.org/cgi/mid.cgi?034C454F-CE2B-4310-BD09-2A9989E544E9 patch < freebsd-xen 9. Build client library and programs: gmake clients 10. Install client library and programs: install libxenstore.so.3.0 /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 Settings -------- Set a required environment variable if you did not apply the patch at step 8.5 in the previous section: export XENSTORED_PATH=/dev/xen/xenstore or if you use csh/tcsh: setenv XENSTORED_PATH /dev/xen/xenstore Usage ----- Now you can do things such as: Check if you are running under Xen and output the Xen version number as well as the virtualization mode (HVM or PV): xen-detect Output the name of your virtual machine: xenstore-read name List some information about your devices: xenstore-ls device List information about your first network device from the backend side with different output format: xenstore-ls -f `xenstore-read device/vif/0/backend` Best Regards, -- Janne Snabb / EPIPE Communications snabb@epipe.com - http://epipe.com/