Iohyve/Bhyve Setup Questions Regarding Ubuntu and Arch VMs

Status
Not open for further replies.

KevDog

Patron
Joined
Nov 26, 2016
Messages
462
With some struggle but with some learning, it was fairly easy to set Ubuntu 16.04 with a byhve using iohyve as a frontend. A good documentation of how to do this is found here:
http://gavowen.ninja/2016/07/installing-ubuntu-server-16-04-in-freenas-9-10-beehyve/

Problems I found however with the process are;
1. I already had a bsd jail in place, so a bridge (bridge0) had already been created. For each subsequent byhyve host, I had to manually add the tap interface:

sudo ifconfig tap2 create
sudo ifconfig bridge0 addm tapn <---------n = 0, or 1, or 2, or 3, ....etc


For every bhyve vm, I had to increment the tap number by one. I could foresee problems on reboot. Is the mixing of bsd jails and byhve vms an issue?

2. Because of this limitation, when I configured the iohyve parameters, I had to manually specify the interface name. I'm wondering what's going to happen after a reboot, although I suppose its totally possible to script the process. The tap interface was set with code similar to the following:

sudo iohyve set <Virtual Machine Name> set tap=tapn n = 0, 1, 2, or 3, etc


3. If configuring multiple byhve virtual machines, the console number had to subsequently incremented

sudo iohyve set <Virtual Machine Name> set con=nmdmn n = 0, 1, 2, or 3, etc


I created both a Ubuntu and Arch linux virtual machine. I found I could only use MBR scheme partitioning with both setups. I wanted to use a GPT partition table, but found this never worked. I was looking for confirmation --- Do all bhyve vm's require MBR partitioning?

My ubunty iohyve configuration is as follows:
Code:
$ sudo iohyve getall ubuntu
Getting ubuntu iohyve properties...
bargs		  -A_-H_-P
boot		   0
con			nmdm1
cpu			1
description	Sat Jan  7 21:23:22 CST 2017
install		no
loader		 grub-bhyve
name		   ubuntu
os			 debian
persist		1
ram			2G
size		   30G
tap			tap0
template	   NO
vnc			NO
vnc_h		  600
vnc_ip		 127.0.0.1
vnc_tablet	 NO
vnc_w		  800
vnc_wait	   NO


In general setup of Ubuntu pretty straightforward. However:

How do you remove a parameter of unset it with the use of iohyve?

If I use the command iohyve set <vm> set parameter=n, and I type the parameter name incorrectly, how do I remove the parameter?? I find the setting the parameter to null or parameter= doesn't remove the variable. There isn't any unset parameter

Arch Linux problems
After creating a new iohyve instance I was able to install Arch Linux with MBR partitioning. My iohyve Arch Linux file is as follows:
Code:
$ sudo iohyve getall arch-on-FreeNAS
Getting arch-on-FreeNAS iohyve properties...
arch				linux
bargs			   -A_-H_-P
boot				0
con				 nmdm0
cpu				 2
description		 Sun Jan  8 01:17:24 CST 2017
grub_run0		   linux
grub_run_partition  (hd0,msdos1)
instal			  0
install			 no
loader			  grub-bhyve
name				arch-on-FreeNAS
os				  arch
persist			 1
ram				 2G
size				400G
tap				 tap2
template			NO
vnc				 NO
vnc_h			   600
vnc_ip			  127.0.0.1
vnc_tablet		  NO
vnc_w			   800
vnc_wait			NO


Booting arch is a challenge. No matter how I start the machine, I dumped to the grub command prompt. At the prompt, I had to enter the following (this configuration may be different depending on your partition arrangement -- you need to find the drive and partition with the vmlinuz-linx and initramfx-linux.img files. You also need to specify the root or / partition. When at the command line I have to type the following to complete the boot:


linux (hd0,msdos1)/vmlinuz-linux root=/dev/sda3
initrd (hd0,msdos1)/initramfs-linux.img
boot


Is there a way to pass these parameters to iohyve? Within another byhve frontend vm-hyve, it appears you can pass these paramaters (which go to the grub-bhyve process in order to load the kernel).

When installing arch, is the addition of the intel microcode necessary? I have a xeon processor but was wondering about passthrough?
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
I already had a bsd jail in place, so a bridge (bridge0) had already been created. For each subsequent byhyve host, I had to manually add the tap interface:
That shouldn't be the case. When the VM boots, the tap interface is automatically created. If that's not happening, please open a bug at https://bugs.freenas.org/
 

KevDog

Patron
Joined
Nov 26, 2016
Messages
462
Edit ---
Solution to booting arch linux without entering grub parameters on the command line

Ensure first that loader=grub-bhyve and os=custom.
Then create a grub.cfg file. The location of this file will depend on your zfs setup. When setting up, I created it the root of the pool -- for my setup /mnt/iohyve. The name of my arch VM is called arch-on-FreeNAS. So within the directory /iohyve/arch-on-FreeNAS, I created a grub.cfg file containing:

Code:
timeout=10
menuentry 'guestname (bhyve)' {
		root=hd0,1
		linux /vmlinuz-linux root=/dev/sda3
		initrd /initramfs-linux.img
}


I remember reading this long ago but didn't remember until recently that hd0,1 is equivalent to (hd0,msdos1) -- That's grub language. Probably known to most users.

My root partition is on /dev/sda3 -- so ensure you set this parameter to where your root partition is located which was established when you partitioned and setup the Arch install

As of yet this is rather a hack, since it would be great if the installation could actually read the grub.cfg file on the remote guest, however I don't think this is possible right know with the current iohyve version (iohyve v0.7.7 2016/11/10 I Think I'll Go for a Walk Edition)
 
Last edited:
Status
Not open for further replies.
Top