HOWTO: Debian Installation on FreNAS (bhyve)

Just finished, here are the steps I followed:

Add to System->Tunables (rc.conf):

ng_ther_load=“YES”
iohyve_enable="YES"
iohyve_flags="kmod=1 net=em0"

Setup pool “ssd” for virtual machine:

iohyve setup pool=ssd

Setup network bridge (check your interfaces with ifconfig):

iohyve setup net=em0

Load kernel modules:

iohyve setup kmod=1

Fetch Debian network install ISO

iohyve fetchiso http://cdimage.debian.org/debian-cd/8.4.0/amd64/iso-cd/debian-8.4.0-amd64-netinst.iso

Set up VM

iohyve create roonserver 50GB
iohyve set roonserver ram=2GB
iohyve set roonserver cpu=1
iohyve set roonserver loader=grub-bhyve
iohyve set roonserver boot=1

Start installation (boot the ISO):

iohyve install roonserver debian-8.4.0-amd64-netinst.iso

Connect to virtual serial console (login root, no pw, exit the console with ~~. ):

iohyve console roonserver

Follow the on screen GUI to install

When asked for packages, deselect the GUI and select SSH

Edit the network interface file

vi /etc/network/interfaces

In the interfaces file look for a line such as:

iface eth0 inet dhcp

Put a hash at the beginning of the line to disable it or delete it:

#iface eth0 inet dhcp

#Add the following lines
# The loopback interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
#your static IP
address 192.168.0.225
#your gateway IP
gateway 192.168.0.1
netmask 255.255.255.0
#your network address “family”
network 192.168.0.0
broadcast 192.168.0.255

Enable root login via ssh:
cd /etc/ssh/
cp sshd_config sshd_config.org
vi sshd_config

Find the following line in /etc/ssh/sshd_config

Remove the # and change prohibit-password to yes from the line below:

PermitRootLogin prohibit-password

becomes:

PermitRootLogin yes

Stop the system

init 0

And test with:

iohyve destroy roonserver
iohyve start roonserver
iohyve console roonserver

Make certain your freenas has the NFS share set up

Enter:

mkdir /mnt/MusicStore
mount -t nfs titan:/mnt/DataVault/MusicStore /mnt/MusicStore

Edit /etc/fstab to include the mount using a line:

mount -t nfs titan:/mnt/DataVault/MusicStore /mnt/MusicStore

Also add the following lines for SSDs:

tmpfs /var/log tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0

###Save and test using the following commands:
umount /mnt/MusicStore
mount -av

IMPORTANT There should not any error messages!!!

RoonServer Installation

apt-get install cifs-utils
apt-get install curl

Make directories

cd /opt

curl -O http://download.roonlabs.com/builds/roonserver-installer-linuxx64.sh
chmod +x roonserver-installer-linuxx64.sh
./roonserver-installer-linuxx64.sh

Follow the prompts

Restore your Roon backup into /var/roon/RoonServer

4 Likes

Just did some spot performance testing, on the NAS I can stream to two Roon endpoints, run a 1080p movie in Plex and hammer a share with a backup from my Mac easily. I have not yet seen the CPU crest 20% and no hiccups anywhere. I am running on an i3-4170 3.7GHz CPU with 8GB of RAM. I’ll pop in another 8GB SIMM to bring my total to 16GB as my memory utilization gets close to 100%.

Thanks Peter,

i followed your HOWTO and succeeded Halfway! Here my recomendations to clarify a few points in your HOWTO:

For the Network Setup of Debian you should explicitally tell that the user have to take a static IP of his own Network (out of Range of his DHCP-Range to not collide with ip-numbers already in use).

It would even be better to recommend nano instead vi as editor because it is a bit easier to use.

The Line: “mount -t nfs titan:/mnt/DataVault/MusicStore /mnt/MusicStore” isn’t completely clear. “Titan” is what? My Rig is named “Freenas”, so i think this is the name of youre freenas appliance. The ip would also do here or maybe is more clear to the user following the tutorial.

The Line “mount -t nfs titan:/mnt/DataVault/MusicStore /mnt/MusicStore” (with ones own path, btw) works, but using the same Line for /etc/fstab didn’t work for me, i used instead:

[freenasIP]:/mnt/[path_to_your_musicfiles] /mnt/MusicStore nfs rw        0 	0      

Using “mount -av” should not give any error messages or else one should go back and try correcting the path in /etc/fstab until it works.

So, my Musicfiles are Mounted in /mnt/MusicStore but if i try to add them as a local folder under Roon on Mac or iPad Roon didnt find any Files, the path /mnt/MusicStore gets accepted by Roon, but no scanning takes place. Only mounting the Files on my Mac via smb:// worked and the files get scanned and i can play them via Roon effortlessly. My Folder with Roon Files was also shared via smb, so i deleted the cifs-share, gave recursively all files root-ownership (instead of mine) restartet my roonserver and now my local path “/mnt/MusicStore” worked fine, all files get scanned. Maybe i need to mount the share with user/pw in debian to be able to also use them as cifs-share, i don’t know. Maybe someone can help here with the correct procedere to share with the VM via NFS and also with mac via SMB.

My FreeNAS Machine is a 2,4GHz 8core AVOTON-Board (ASRock C2750I), 32GB RAM, Byhyve and the 50GB RoonServer lives on a 240GB SSD, Musicfiles on a single 8TB WDRED with ZFS. Using Roon with all my Devices is instanteuos, no lag, no stuttering, whatever. I can even have 2 PLEX-Streams running from the same machine while listening to DSD64 (which gets handled from a raspberry Pi to my USB DAC.). The VM has 2GB RAM and 1 core, maybe i should give a GIG RAM more or 1 core more, but why? Everithing seems to work fine now. Will see…

Thanks for any comments in advance,

Bernd

On Jul 22 and 23 2017, I had a go at installing Roon Server in a FreeNAS iohyve environment using the spells given above. It mostly went smoothly. The biggest glitch I ran into was how to restart the roon guest OS once Debian installation completed. The “And Test With” commands do this. You may want to change this section.

  1. I use iTunes on my Mac to maintain the music library.

  2. Apple recommended SMB sharing over NFS and i took the hint assuming it would be better supported than NFS which is a bit nitchy these days. If you use the SMB:// URL, the URL must be entered as shown in this example: SMB://ROONHOST.local/Share_Name

  3. Debian installs with avahi configured so I let DHCP configure the networking and use rocky.local (rocky is host name, local is MDNS domain). This works well with Roon Controllers.

  4. Roon appears to remember SMB mounts so there was no need to put them in FSTAB.

One note about Roon CIFS share configuration. Roon is case sensitive so you have to get the exact case for the host name (cleverly FreeNAS) and the case sensitive spelling of the share name. This is most easily done in the FreeNAS Sharing GUI for the CIFS share.

Thanks for describing your setup.
In my case (3100 albums) 3GB RAM for the Roon server (core only) was not enough (only 60 MB was left).
I just increased it to 4 GB RAM.
.

Hi,
i followed this tutorial to install roon on my freenas machine and it worked really well for about 2 weeks. But suddenly my iohyve virtual machine stopped working. So investigated and it looks like the virtual machine is not being able to access the network anymore. Iam not sure why, it was working great for 2 weeks and then stopped.
There is a couple of things iam not sure i understand correctly.

on the line:
iohyve_flags="kmod=1 net=em0"
this is to set the ethernet interface for the vm ?
i don’t have the em0 in the ifconfig:

igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=6403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6>
ether 0c:c4:7a:86:67:d8
hwaddr 0c:c4:7a:86:67:d8
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: no carrier
igb1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2400b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6>
ether 0c:c4:7a:86:67:d9
hwaddr 0c:c4:7a:86:67:d9
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect (1000baseT )
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
tap1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: iohyve-roon–
options=80000
ether 00:bd:f0:0e:f8:01
hwaddr 00:bd:f0:0e:f8:01
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: no carrier
groups: tap
tap2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: iohyve-roonserver–
options=80000
ether 00:bd:bc:24:f8:02
hwaddr 00:bd:bc:24:f8:02
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
groups: tap
Opened by PID 6707
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:0d:36:85:fc:00
nd6 options=1
groups: bridge
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: tap3 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 12 priority 128 path cost 2000000
member: epair3a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 10 priority 128 path cost 2000
member: epair2a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 9 priority 128 path cost 2000
member: epair1a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 8 priority 128 path cost 2000
member: epair0a flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 7 priority 128 path cost 2000
member: igb1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 20000
epair0a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:7b:50:00:07:0a
hwaddr 02:7b:50:00:07:0a
nd6 options=1
media: Ethernet 10Gbase-T (10Gbase-T )
status: active
groups: epair
epair1a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:7b:50:00:08:0a
hwaddr 02:7b:50:00:08:0a
nd6 options=1
media: Ethernet 10Gbase-T (10Gbase-T )
status: active
groups: epair
epair2a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:7b:50:00:09:0a
hwaddr 02:7b:50:00:09:0a
nd6 options=1
media: Ethernet 10Gbase-T (10Gbase-T )
status: active
groups: epair
epair3a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:7b:50:00:0a:0a
hwaddr 02:7b:50:00:0a:0a
nd6 options=1
media: Ethernet 10Gbase-T (10Gbase-T )
status: active
groups: epair
tap3: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000
ether 00:bd:70:c8:f8:03
hwaddr 00:bd:70:c8:f8:03
nd6 options=1
media: Ethernet autoselect
status: active
groups: tap
Opened by PID 10966

similar issue with this line:
iohyve setup net=em0

what should i use in my case ? I tried to change this to another inerface, but i get this error:
#iohyve setup net=igb0
bridge “bridge1” is already enabled on this machine…
sysctl already setup properly as well…

if you have any idea why my debian VM don’t access the network, please let me know

I can’t check my system any more, I am on a dedicated Debian box now. You seem to have three or four interfaces being configured. Only the 1000Base-T has an IP address assigned. Check to see which interface eth0 is pointing to, it may be pointing to one of the unconfigured devices.

BTW, you seem to have some 10G ports. What hardware are you using for those?

Thanks for your answer Peter,
my motherboard is a Supermicro X10SL7-F and according to the manual, this is the lan interface:
2x RJ45 Gigabit Ethernet LAN ports
1x RJ45 Dedicated IPMI LAN port
https://www.supermicro.com/products/motherboard/xeon/c220/x10sl7-f.cfm

I don’t know why there is 10G ports listed there.

How can i check where eth0 is pointing to ?

this is what i get when i test eth0…

#ip a show eth0 up
Device “eth0” does not exist.

This is my /etc/network/interfaces

The loopback network interface

auto lo0
#iface lo0 inet loopback

#My IP description
#IPv4 address
auto enp0s3
iface enp0s3 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

And when i test enp0s3 i get:

ip a show enp0s3 up

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:a0:98:ba:de:1f brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::2a0:98ff:feba:de1f/64 scope link
valid_lft forever preferred_lft forever

UPDATE:
i solved partly the issue! i changed
iohyve_flags=“kmod=1 net=em0”
to
iohyve_flags=“kmod=1 net=igb1”
restarted freenas, and now i can ping the roon core server from my local network.
BUT, VM doesnt access internet. It fails when i do apt-get update.
Could it be a dns issue ?

What are your Ethernet devices on your FreeNAS?

The plugged ethernet interface is igb1:

igb1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2400b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6>
ether 0c:c4:7a:86:67:d9
hwaddr 0c:c4:7a:86:67:d9
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect (1000baseT )
status: active

Any idea why em0 doesnt work as expected like in your example ?

It is a DNS issue i think, i edited /etc/resolv.conf and added:

nameserver 38.132.106.139
nameserver 194.187.251.67

and now “ping 8.8.8.8” within the VM works!
But when i “ping google.com”, i get the error:

ping: google.com: Name or service not known

Can you ping the router from your VM?

I actually found the issue, its coming from /etc/resolv.conf.
every time i restart the VM the file goes empty.
and if i had to it:
nameserver 192.168.1.1
then everything works again …

An update for any interested parties: I’m running FreeNAS 11.2-RC1 on a retired datacenter server from The Server Store. I tried at first to install ROCK in a VM, but got stuck at how to create a bootable ROCK ISO.

So I created a Debian VM using the FreeNAS GUI and installed the Roon Server as normal for a Linux install. I used the Virtio driver for the VM, and it works like a charm, accessing my music SMB share. I’ve temporarily assigned 16 of 48 cores to the VM, and it’s cranking through 160,000 tracks at about 10 per second. The instructions in this thread were helpful, of course, but I wanted to let y’all know that using the FreeNAS GUI made it all even simpler.

1 Like