These are my notes. Modify for your system. I do the initial install over VNC, then set up console (see references for other approaches).
# Connect to DOM0. Might as well port forward for VNC ssh -L localhost:5906:localhost:5901 user@DOM0.IP sudo su # become root # make someplace to store ISO mkdir -p /home/xen-store/isos cd /home/xen-store/isos # Download an ISO install, either CD or DVD into /home/xen-store # See https://www.freebsd.org/where.html # find image, right click and copy URL; place in next step wget https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/11.2/FreeBSD-11.2-RELEASE-amd64-disc1.iso.xz # uncompress image xz -d FreeBSD-11.2-RELEASE-amd64-disc1.iso.xz Create an LV in /dev/vg0 lvcreate -L 20G -n freebsd vg0 # ensure there is nothing bootable on our new image dd if=/dev/zero of=/dev/vg0/freebsd bs=2048 count=1
builder = "hvm" name = "freebsd" memory = 4096 vcpus = 12 vif = [ 'bridge=xenbr0', # or you can set values. MAC must be unique in the network # 'mac=00:16:3E:FB:3E:10,vifname=freebsd0,bridge=xenbr0', ] disk = [ 'phy:/dev/vg0/freebsd,hda,w', 'file:/home/xen-store/FreeBSD-11.2-RELEASE-amd64-disc1.iso.xz,hdc:cdrom,r' ] boot = "cd" # Boot to hard disk image usbdevice = 'tablet' vnc = 1 vncdisplay=1 # serial = "pty"
Ready to start the virtual for the first time. When you are done with the install, it will try to reboot into the image again, so you must let it, then destroy it (last two steps).
xl create /etc/xen/freebsd.hvm
If it reboots into the CD, then there is an issue. Simply kill it, then destroy it and remove change the boot line to boot = 'c'
xl destroy freebsd
If you want to use xl console, do the following:
serial = "pty"