Difference between revisions of "FreeBSD under HVM"

From PrgmrWiki
(partition the disk)
(Redirected page to FreeBSD)
 
Line 1: Line 1:
I'm setting up FreeBSD under HVM, and compiling a FreeBSD Xen paravirt kernel.  here are my notes. 
+
#REDIRECT [[FreeBSD]]
 
 
 
 
There is talk that Mr. Macy has gotten support for running FreeBSD 8-Current i386PAE as a paravirt DomU in 8-current http://unix.derkeiler.com/Mailing-Lists/FreeBSD/current/2008-08/msg00551.html  so, this page will document how to actually set this up. 
 
 
 
First, if you don't alrealdy have an 8-current i386 box about, you need to install one.  ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/200809/8.0-CURRENT-200809-i386-disc1.iso is what I'm using, but you probably want to use whatever is latest.
 
 
 
 
 
So, you can do this with the serial console, but I wasn't able to set it up correctly.  what follows is a xm config file that worked redirecting video over vnc:
 
<pre>
 
import os, re
 
arch = os.uname()[4]
 
if re.search('64', arch):
 
    arch_libdir = 'lib64'
 
else:
 
    arch_libdir = 'lib'
 
 
 
kernel = "/usr/lib/xen/boot/hvmloader"
 
builder='hvm'
 
memory = 1024
 
name = "fbsd_hvm"
 
vcpus=1
 
pae=1
 
acpi=0
 
vif = [ 'type=ioemu, bridge=xenbr0' ]
 
disk = [
 
        'phy:/dev/hind_domU/fbsd_test,hda,w',
 
        'file:/root/fbsd_disk.img,hdb,w',
 
        'file:/root/8.0-CURRENT-200809-i386-disc1.iso,hdc:cdrom,r'
 
]
 
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
 
#boot="dca"
 
boot="cd"
 
vnc=1
 
vnclisten="192.168.1.102"
 
serial='pty'
 
 
 
</pre>
 
 
 
 
 
Now, you want to install the 'kern developer' package when you install.
 
 
 
make sure to answer yes to the 'do you want to install ports' question.
 
 
 
'''Note: if you are on a recent version of FreeBSD, csup is included in base and thus you don't need to install cvsup from ports.  It is a functional equivilent excepting the repository mirroring ability of cvsup.'''
 
 
 
After you install, pkg-add -r cvsup  (you can build this from ports, but warning, it will take quite some time. )
 
 
 
next execute
 
 
 
cvsup -g /usr/share/examples/cvsup/standard-supfile -h cvsup11.freebsd.org
 
 
 
If you are using csup instead of cvsup, just change the command, all arguments remain the same.
 
 
 
(standard-supfile fetches HEAD.  for normal operation you likely want  stable-supfile. But this isn't normal operation, now is it.  This is Xen.)
 
 
 
after you are done checking out current sources,
 
 
 
cd /usr/src
 
 
 
edit /usr/src/sys/i386/conf/XEN  if required
 
 
 
First, I want to
 
==partition the disk==
 
 
fdisk -Bi ad1
 
disklabel -w -i ad1
 
disklabel -e ad1
 
 
 
# /dev/ad1s1:
 
8 partitions:
 
#        size  offset    fstype  [fsize bsize bps/cpg]
 
  a:  262144    16    unused        0    0
 
  b:  2882737  262160    unused        0    0
 
  c:  3144897        0    unused        0    0        # "raw" part, don't edit
 
 
 
fbsd#  newfs /dev/ad1s1a
 
/dev/ad1s1a: 128.0MB (262144 sectors) block size 16384, fragment size 2048
 
using 4 cylinder groups of 32.02MB, 2049 blks, 4160 inodes.
 
super-block backups (for fsck -b #) at:
 
160, 65728, 131296, 196864
 
fbsd# newfs /dev/ad1s1b
 
/dev/ad1s1b: 1407.6MB (2882736 sectors) block size 16384, fragment size 2048
 
using 8 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
 
super-block backups (for fsck -b #) at:
 
160, 376512, 752864, 1129216, 1505568, 1881920, 2258272, 2634624
 
fbsd# tunefs -n enable /dev/ad1s1b
 
tunefs: soft updates set
 
 
 
 
 
 
 
csup -g /usr/share/examples/cvsup/standard-supfile
 
pkg_add -r cvsup
 
cvsup -g /usr/share/examples/cvsup/cvs-supfile
 
 
 
(probably don't need both, but what do I know)
 
 
 
 
 
fbsd# mkdir /xenworld
 
fbsd# mount /dev/ad1s1b /xenworld
 
fbsd# mkdir /xenworld/boot
 
fbsd# mount /dev/ad1s1a /xenworld/boot
 
 
 
 
 
then
 
  make buildworld
 
  make buildkernel KERNCONF=XEN
 
  make installworld DESTDIR=/xenworld
 
  make installkernel DESTDIR=/xenworld
 
 
 
scp /xenworld/boot/kernel/kernel to somewhere on the Dom0, you will need it later.
 

Latest revision as of 17:07, 16 July 2018

Redirect to: