FreeNAS as Xen DomU

Status
Not open for further replies.

esromneb

Cadet
Joined
Feb 19, 2013
Messages
2
I am new to FreeBSD but I am a Linux expert. I am trying to get FreeNAS to run under Xen as DomU in PV mode. Specifically I would like to run under XenServer. Earlier today I accomplished this task using FreeBSD 9.1, I even wrote a guide with a torrent to the final product: https://github.com/esromneb/BMXenServer/wiki/PV-FreeBSD-DomU-Kernel If I can figure out FreeNAS under Xen I will write up a guide just like it.

I have a few questions that I can't figure out regarding the FreeNAS boot process.

1) is using a newer kernel (9.1) a problem for freenas 8?
2) I have configured a FreeNAS install with the following options:
xe vm-param-set uuid=$VMU PV-args='boot_verbose=1,vfs.root.mountfrom=ufs:/dev/xbd0s1a,vfs.root.mountfrom.options=rw,kern.hz=100 console=tty0 xencons=tty'
I'm positive that '/dev/xbd0s1a' is the location of root: I verified this by booting my working FreeBSD machine, and attaching my FreeNAS boot disk. The xbd block names match.

When I start the VM I get this kernel panic:

GEOM: new disk xbd0
Timecounter "TSC" frequency 3000122000 Hz quality 800
WARNING: WITNESS option enabled, expect reduced performance.
GEOM: xbd0s1: geometry does not match label (16h,63s != 255h,63s).
Trying to mount root from ufs:/dev/xbd0s1a [ro]...
rtc0: [XEN] xen_rtc_gettime
rtc0: [XEN] xen_rtc_gettime: wallclock 1360061375 sec; 434968138 nsec
rtc0: [XEN] xen_rtc_gettime: uptime 1204933 sec; 56183913 nsec
rtc0: [XEN] xen_rtc_gettime: TOD 1361266308 sec; 491152051 nsec
start_init: trying /sbin/init
exec /sbin/init: error 8
start_init: trying /sbin/oinit
start_init: trying /sbin/init.bak
start_init: trying /rescue/init
exec /rescue/init: error 8
start_init: trying /stand/sysinstall
init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall
panic: no init
cpuid = 0
KDB: enter: panic
[ thread pid 1 tid 100002 ]
Stopped at kdb_enter+0x3a: movl $0,kdb_why
db>

I don't understand how FreeNAS boot configuration is different than stock FreeBSD. Please help me get moving here. Could this problem be caused my mis-matching kernel versions?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I'm not a FreeBSD expert, but I'm definitely learning lots experimenting with FreeNAS. I don't think trying to use the 9.x kernel will work. My first guess would be that your errors are directly related to using a different kernel. There have been a few threads discussing 9.x over the last year or so, and its not going to be an easy transition to get FreeNAS built on FreeBSD 9. There are quite a few features that are somewhat critical for many users(such as zfsd which is only available on FreeBSD 9) that can't be backported, nor can FreeNAS be easily updated to FreeBSD 9. So FreeNAS is somewhat stuck in this place where we are old enough to not have some features but the project is good enough that those features are really desired.

If you can get FreeNAS to run on FreeBSD 9 I can bet you'll be getting alot of PMs from the developers to implement your changes.
 

esromneb

Cadet
Joined
Feb 19, 2013
Messages
2
So it turns out that this error:
exec /sbin/init: error 8
means that I'm trying to run 64 bit binaries on a 32 bit kernel. So basically I'm stupid.

To answer your question cyberjack, I did get it to "run" but actually freenas was throwing a lot of errors. I didn't know the state of FreeBSD vs FreeNAS, but thanks for filling me in. Maybe someday I'll get good enough to help the team port it! Thanks for your help.
 

louisk

Patron
Joined
Aug 10, 2011
Messages
441
You are also likely to run into issues with mismatch between ZFS in kernel and userspace, and possibly other things as well. FreeBSD keeps API and abi in sync between kernel and userspace, and when you venture away from this, you are essentially wandering in the desert. You may get lucky, but probably not. It would be easier to figure out the build requirements for FreeNAS and do that on 9.1.
 
Status
Not open for further replies.
Top