Bug 201787 - Better documentation for Xen domU support
Summary: Better documentation for Xen domU support
Status: Closed Feedback Timeout
Alias: None
Product: Documentation
Classification: Unclassified
Component: Books & Articles (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-doc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-23 13:23 UTC by Jeroen
Modified: 2017-09-07 02:41 UTC (History)
3 users (show)

See Also:


Attachments
xen domU example config (560 bytes, text/plain)
2015-07-24 10:40 UTC, Jeroen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen 2015-07-23 13:23:36 UTC
FreeBSD has made some great strides in the last few years for Xen support. Especially the addition of HVM into the kernel has made it a lot easier to run FreeBSD on any Xen Dom0.

Documentation has never been the strong suit of the Xen project. Unfortunately, the documentation on the FreeBSD side is also somewhat chaotic, and mostly revolves around the wiki page.

I have some small texts already on how to configure Xen to create a working FreeBSD DomU, and which options are available to you, how to deal with them, etc.

Furthermore, there might for example be some places in the documentation where you could add some references to specific Xen circumstances, e.g. the serial console setup.

What is the best way to approach this?
Comment 1 Allan Jude freebsd_committer freebsd_triage 2015-07-23 14:37:38 UTC
If you can submit some documentation, even just in plain text, the documentation team will be happy to edit it and mark it up for inclusion in the FreeBSD handbook.
Comment 2 Jeroen 2015-07-24 10:36:06 UTC
I already emailed about step 3 in 26.6.1 (https://www.freebsd.org/doc/handbook/serialconsole-setup.html), that line is confusing and not very helpful. It should probably be something more along the lines of:

3. Make sure that the entry on `ttyu0` in `/etc/ttys` is like the following (it may already be like this):

  ttyu0   "/usr/libexec/getty std.9600"   vt100   onifconsole secure


Somewhere on that page there should probably also be a reference to setting up a serial console on a Xen domU instance.
In order to make the console work on a Xen HVM instance, make sure the configuration file contains an entry like below. The console can then be approached through the Xen command line utilities.

  serial='pty'
Comment 3 Jeroen 2015-07-24 10:40:52 UTC
Created attachment 159140 [details]
xen domU example config
Comment 4 Jeroen 2015-07-24 10:52:40 UTC
I've attached an example configuration that works on a Debian Dom0 with Xen 4.4 and the (now default) xl toolkit, this works with a 10.1 system.

The configuration features two networking interfaces, which will be xl0 and xl1 consecutively in the FreeBSD. The IP addresses are not strictly necessary, but may be useful for administration on the Dom0 side.

There are also two disks in the configuration, in this case the first is a LogicalVolume made on the Dom0. This disk will be presented as a raw disk to the Xen instance, and can be partitioned as desired, including ZFS.

The `boot='c'` statement makes sure that the domU instance will boot from CD-ROM when one is connected. The `serial='pty'` statement makes sure that the console is properly connected, this can then be approached using `xl console` or using the `-c` flag when creating the domU.

Finally the `vnc=0` statement disables VNC connection. This can be enabled by setting it to `1`, and uncommenting the following two lines. A VNC connection can then be made by using an SSH tunnel to the dom0 host, protected by a password, if desired.
Comment 5 mark 2015-08-05 14:14:07 UTC
(In reply to Jeroen from comment #4)

Hi Joroen,  thanks for starting this initiative to improve documentation.  I have experience running FreeBSD in Xen HVM as well.

While the sample xen domU config you provided is helpful, it might be useful to also know options that do NOT work or cause problems, have you run into any such cases?  I'm still using 'xm' toolkit so I'm not sure if there are cases from going to 'xl' dom0 that cause problems booting FreeBSD domUs

Also you mentioned xl0/xl1 interfaces in FreeBSD, but this should be xn0/xn1, correct?
Comment 6 Benedict Reuschling freebsd_committer freebsd_triage 2017-07-27 16:57:21 UTC
We have documented Xen in the handbook now, based on the wiki page and Xen docs mentioned: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/virtualization-host-xen.html

Is there a need to keep this PR open any longer? Additions to the handbook page are welcome, of course.
Comment 7 Benedict Reuschling freebsd_committer freebsd_triage 2017-09-07 02:41:30 UTC
PR closed, we have a Xen chapter now.