Introduction¶
This HOWTO cover how to configure XEN in order to be able to install OpenBSD as a virtual machine (DomU).
Preperation and installation¶
Download OpenBSD installation ISO to the Xen Server¶
In this HOWO we use OpenBSD 5.7. We have created a directory called /opt/images where we download the installation image for OpenBSD.
cd /opt/images && wget "http://ftp.eu.openbsd.org/pub/OpenBSD/5.7/amd64/install57.iso"
Create a Logical Volume in LVM for the disk¶
lvcreate -n openbsd-disk -L 4G <path to volume group>
Adjust the disk size to your needs.
Create your Xen configuration file¶
/etc/xen/openbsd.cfg
builder = 'hvm' memory = '256' vcpus = 1 # Adjust Logical Volume path to your location disk = [ 'phy:/dev/vg_md0/openbsd-disk,ioemu:hda,w', 'file:/opt/images/install57.iso,ioemu:hdc:cdrom,r', ] # Hostname name = 'openbsd' # Networking, Adapt bridge to your needs vif = ['mac=00:16:3E:B6:AA:BB, bridge=br_200, model=e1000'] # Boot on disk first then on cdrom boot = 'cd' vnc = 1 vncviewer = 0 # Bind to port 5910, should be unique for each virtual server vncdisplay = 10 sdl = 0
Start the installation¶
xl create /etc/xen/openbsd.cfg
NOTE: On Wheezy and earlier use xm instead of xl
Start VNC and connect to port 5910, this will give you access to the graphical console of the virtual machine.
NOTE: You might need to port forward the VNC port if you are using SSH to access your Xen Server.
ssh <IP to your Xen Server> -L 5910:127.0.0.1:5910
In this case use vncviewer localhost:10
to connect to the console.
Post installation recommendations for OpenBSD (DomU)¶
The following steps are optional.
Recommended packages to install¶
pkg_add -v http://ftp.sunet.se/pub/OpenBSD/5.7/packages/amd64/git-2.3.0.tgz pkg_add -v http://ftp.sunet.se/pub/OpenBSD/5.7/packages/amd64/bash-4.3.33.tgz pkg_add -v http://ftp.sunet.se/pub/OpenBSD/5.7/packages/amd64/wget-1.16.1.tgz pkg_add -v http://ftp.sunet.se/pub/OpenBSD/5.7/packages/amd64/lsof-4.87p4.tgz pkg_add -v http://ftp.sunet.se/pub/OpenBSD/5.7/packages/amd64/ngrep-1.45p4.tgz
Setup git version control of /etc¶
cd /etc git config --global user.name "Your Name" git config --global user.email you@example.com git init git add . git commit -a -m "Post install state"
Upgrade to OpenBSD 5.7 snapshot¶
If you like to upgrade to the latest snapshot, you can follow this guide.