Tutorial: DSM 6.2 on bhyve (FreeNAS/FreeBSD)


Recommended Posts

As of a FreeBSD user, I use ZFS to store my data, but DSM provide some feature/app very nice,

I would show how to run XPenology DSM 6.2 on FreeBSD 12.1R.

 

Hardware configuration will be a little special. here is my Build:

  • Xeon E5 2687v2 * 2
  • SuperMicro X9DRH-iF
  • 256GB RAM
  • other staff.

 

Because bhyve only support e1000/virtio-net emu adapter, for performance and stability consideration

a physical ethernet interface will be provide better performance.

 

The key is MB/CPU should support VT-d, otherwize you have to choose a newer CPU platform(XEON E5 v3 or above) to run DS918+.

which is support e1000.

 

I will not cover how to install FreeBSD/vm-bhyve and config VT-D here.

 

by using vm-bhyve, the vm config file will be as follow:

loader="uefi-csm"
cpu=8
cpu_sockets=1
cpu_cores=4
cpu_threads=2
memory=4G
ahci_device_limit="1"
disk0_type="ahci-hd"
disk0_name="ds3617-1.03b.img"
disk1_type="ahci-hd"
disk1_name="disk0.img"
disk1_opts="sectorsize=4096/4096"
debug="yes"
passthru0="3/0/0"

since I am running ds3617+ with 1.03b loader, I use 8 vcpu and 4G ram. and, two disks. one is 50M jun loader, 

and one data disk. which is disk0.img.

 

there is a ahci_device_limit=1 here. that is tell vm-bhyve will use one SATA controller for one disk.

ther reason I will explain later.

 

since our HDDs are organize by FreeBSD's zfs, only one data disk here is enough. we can make it larger.

such as 100TB, so we won't have space issue on DSM later.

 

So the VM folder will have 3 files.

root@nas253:/zones/vm/jnas # ls -lh
total 21798
-rw-------  1 root  wheel   100T Mar  1 08:27 disk0.img
-rw-r--r--  1 root  wheel    50M Aug  1  2018 ds3617-1.03b.img
-rwxr-xr-x  1 root  wheel   255B Mar  1 08:26 jnas.conf

 

before you start the VM, make sure you have a DHCP server running in your local network.

vm start jnas

after the, you can attach to console by using following command

vm console jnas

 

and you will see the serial output.

Running /usr/syno/etc/rc.d/J99avahi.sh...
Starting Avahi mDNS/DNS-SD Daemon
cname_load_conf failed:/var/tmp/nginx/avahi-aliases.conf
:: Loading module hid ... [  OK  ]
:: Loading module usbhid ... [  OK  ]
============ Date ============
Sun Mar  1 08:30:59 UTC 2020
==============================
starting pid 5957, tty '': '/sbin/getty 115200 console'

Sun Mar  1 08:31:00 2020

DiskStation login: 

after you saw this, you can query which IP is assigned by your DHCP server. and access that IP

by web browser and contine setting.  the steps are common.

 

As the loader disk is shown inside DSM, you can modify grub.cfg and replace following setting.

set sata_args='DiskIdxMap=1F00'

and make sure loader entry use this parameter. (grub boot select ESXi entry, or by modify enty setting)

 

that is all. thanks.

 

Here is an instance I have already run for half year

 

2020-03-01_173928.png.575072f56292065926df61f5a13183c9.png

 

2020-03-01_174030.thumb.png.0f20697b5f29fb805cd943fba3a223fd.png

 

 Thank you for people who provide loader!!!

 

Edited by IST QIAN
  • Like 1
Link to post
Share on other sites
  • 4 weeks later...

I finally got this working on FreeNAS after MUCH trial and error and wanted to improve upon your instructions:

We'll assume that one can install FreeNAS using any if the available guides on line.  I literally downloaded the iso, burned it to a thumb drive, stuck it in a computer with a second thumb drive available as the install location, and followed the prompts.

Now then, what you want to do is create a Virtual Machine

image.thumb.png.86217be7ee3cbd0f3b8e2d08599e42e9.png

 

UEFI-CSM is the important selection to make note of here

image.thumb.png.dc8f61f9712aa0ddf2accfe94d2ef352.png   

 

I chose 4 vcpus and 4 GB of RAM

image.thumb.png.815ad1bb6f8fb41518f2a11b87d83392.png

 

I chose as much of the available free space that I could since I prefer Synology's interface

image.thumb.png.15deb0c6627555594ec73c0c1354c577.png

 

These were defaults for me

image.thumb.png.1815ecd71f429022debafaad0a8b0b8c.png

 

I left this blank

image.thumb.png.4fafccb4325fb8e8f530368d028e6fcb.png

 

Then you can confirm the options and submit

image.thumb.png.d5a9a307a485b298c4467052f34815a6.png

 

At this point, before you can start it, you have to add the particular IMG you will be using as your boot drive as a raw file. (I put it in a location in the storage pool so that I could browse to it.)  Only DS6315 1.03b and DS6315 1.02b worked for me.

image.thumb.png.50826228e7790cb563a66236c319dc1f.png

 

From here, change the Device Order so that the Raw drive is loaded first, and then turn it on.  In a few minutes, the VM will load, and you can use the Synology Assistant to find it on your network.

 

You can also look at the serial console for informational messages during the boot process.

 

  • Like 1
Link to post
Share on other sites
  • 7 months later...

PrettyGenius, how did you access the Synology interface later? Normally, the web interface is available at the port 5000, right?

 

also could you hint as to how to look for this working image? I found DSM v 6.2.3 - 23426 Rc.v0.02 no install.ova but not this one

Edited by vinjoza
Link to post
Share on other sites
  • 1 month later...
23 hours ago, kobold said:

I've tried the steps of @PettyGenius but it can't get it to work. If I restart the VM en go to console quickly I can see the bootloader GRUB menu, but after selecting one of the items the screen goes black, nothing happens.

I managed to get to the Synology Assistant by setting the disk into VirtIO mode. But then no disk are found. If I change it back to AHCI everything stays black after grub. Any suggestions?

Link to post
Share on other sites
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.