How to create a Freebsd VM inside SmartOS

SmartOS ( needs no introduction: essentially a type 1 hypervisor, running headless, with Illumos as the kernel. ( OpenIndiana and several other distribution are also using Illumos as the kernel.

Bryan Cantrill has given a good talk here:

To create a FreeBSD VM inside SmartOS, here are the detailed instructions:

After inserting the CD (with SmartOS image burned in), bootup, and at the command line, search for the UUID for FreeBSD:

imgadm avail |grep freebsd

imgadm import <UUID>

(the <UUID> come from imgadm list), this will essentially download the entire image from the web.

Downloading the image from the web is slow, so after some time has passed:

vmadm list

df8d2ee6-d87f-11e2-b257-2f02c6f6ce80 freebsd 1.0.0 bsd 2013-06-19T01:30:49Z

d34c301e-10c3-11e4-9b79-5f67ca448df0 base64 14.2.0 smartos 2014-07-21T10:43:17Z

The FreeBSD image is downloaded. So next is to create a manifest file with all the necessary attributes (as adapted from here:

More important, the corresponding image’s manifest as when it was created can be read off here:

Notice the matching UUID. Notice also the “virtio” for disk, and NIC. Changing the value to other value (eg, “ide” for disk, or “e1000” for NIC card) will gives error when booting up the VM OS.

File named as “freebsd.json”:


"alias": "freebsd9",
"hostname": "freebsd9",
"brand": "kvm",
"resolvers": [

"ram": "512",
"vcpus": "1",
"default-gateway": "",
"nics": [
      "nic_tag": "admin",
      "ip": "",
      "netmask": "",
      "gateway": "",
      "model": "virtio",
      "primary": true
"disks": [
      "image_uuid": "df8d2ee6-d87f-11e2-b257-2f02c6f6ce80",
      "boot": true,
      "model": "virtio",
      "image_size": 10240


vmadm create -f freebsd.json

And from the response, “Successfully created VM 74787fa5-509a-4c5d-91eb-dc07dc10662e”:

vmadm info 74787fa5-509a-4c5d-91eb-dc07dc10662e

This will generate a massive amount of display about the attributes of the 747xxxx UUID image.

In particular:

vmadm info 74787fa5-509a-4c5d-91eb-dc07dc10662e vnc
"vnc": {
"host": "",
"port": 38032,
"display": 32132

Using the above information, we can use VNC to log in into that port, and see all the console messages (and graphical display as well). In this case, the SmartOS hypervisor is also providing some VNC server services.

And this will allow you to login via console port (serial port) as well:

vmadm console 74787fa5-509a-4c5d-91eb-dc07dc10662e

Reboot the VM machine:

vmadm reboot 74787fa5-509a-4c5d-91eb-dc07dc10662e

Other subcommands for vmadm are:

Usage: /usr/sbin/vmadm <command> [options]

create [-f <filename>]
create-snapshot <uuid> <snapname>
console <uuid>
delete <uuid>

delete-snapshot <uuid> <snapname>

get <uuid>
info <uuid> [type,...]
install <uuid>
list [-p] [-H] [-o field,...] [-s field,...] [field=value ...]
lookup [-j|-1] [-o field,...] [field=value ...]
reboot <uuid> [-F]
receive [-f <filename>]
reprovision [-f <filename>]
rollback-snapshot <uuid> <snapname>
send <uuid> [target]
start <uuid> [option=value ...]
stop <uuid> [-F]
sysrq <uuid> <nmi|screenshot>
update <uuid> [-f <filename>]
-or- update <uuid> property=value [property=value ...]
validate create [-f <filename>]
validate update <brand> [-f <filename>]


Basic knowledge:

Debugging techniques of Illumos (through VirtualBox, or can be easily modified to QEMU) is given here:

Lots of help from the community (

One of my earlier bugs in manifest (which does not matches that from Joyent in NIC and disk attribute):


One response to this post.

  1. In my journey to fully understand SmartOS there is nothing more important than this:

    In short: just boot it off the CD all the time, use the whole machine (and thus the entire harddisk as well) to boot, and ensure VMX (Intel) is enabled (SVM seemed to be in development stage, and mine AMD-SVM is not working). Anything you do in the default global zone is non-persistent, so create a local zone (via “imgadm avail” and “imgadm import”) if you want to do any persistent stuff.

    This is really non-conventional stuff.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: