Skip to content

Instantly share code, notes, and snippets.

@thelander
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thelander/d72f7f0da27ce1470a44 to your computer and use it in GitHub Desktop.
Save thelander/d72f7f0da27ce1470a44 to your computer and use it in GitHub Desktop.
Run Plex Media Server on FreeBSD in a SmartOS zone

Run Plex Media Server on FreeBSD in a SmartOS zone

This guide assumes you have a working SmartOS setup with your storage zpool(s) imported.

This guide is based on this gist: https://gist.github.com/dreamcat4/f19580cbd31d8f628aca.

Import image and create virtual machine

Find the latest FreeBSD image, in this case d20b8738-7a2a-11e4-bea0-83cb697e6c7c (freebsd-10, 20141202).

$ imgadm avail | grep freebsd
df8d2ee6-d87f-11e2-b257-2f02c6f6ce80  freebsd             1.0.0      bsd      2013-06-19T01:30:49Z
176db8f4-6c6c-11e4-90b1-035076b608cc  freebsd-10          20141115   bsd      2014-11-15T02:07:03Z
d20b8738-7a2a-11e4-bea0-83cb697e6c7c  freebsd-10          20141202   bsd      2014-12-02T13:55:05Z

Import the latest image.

$ imgadm import d20b8738-7a2a-11e4-bea0-83cb697e6c7c
Importing image d20b8738-7a2a-11e4-bea0-83cb697e6c7c (freebsd-10@20141202) from "https://images.joyent.com"
[...]
Imported image d20b8738-7a2a-11e4-bea0-83cb697e6c7c (freebsd-10@20141202) to "zones/d20b8738-7a2a-11e4-bea0-83cb697e6c7c"

Create virtual machine from the imported image.

$ vmadm create << EOL
{
  "alias": "plex",
  "hostname": "plex",
  "brand": "kvm",
  "vcpus": 2,
  "autoboot": true,
  "ram": 512,
  "disks": [
    {
      "image_uuid": "d20b8738-7a2a-11e4-bea0-83cb697e6c7c",
      "boot": true,
      "model": "virtio",
      "size": 8192
    }
  ],
  "nics": [
    {
      "nic_tag": "admin",
      "model": "virtio",
      "ip": "10.0.2.2",
      "netmask": "255.255.0.0",
      "gateway": "10.0.0.1",
      "primary": true
    }
  ],
  "resolvers": ["8.8.8.8", "8.8.4.4"]
}
EOL
Successfully created VM <uuid>

Find the VNC connection information for the newly created virtual machine.

$ vmadm info <UUID> vnc
{
  "vnc": {
    "host": "10.0.1.1",
    "port": 49113,
    "display": 43213
  }
}

Login to the virtual machine using a VNC client.

Install Plex Media Server

Update the local pkg package manager database.

$ pkg update

Upgrade the system.

$ pkg upgrade

Install Plex Media Server.

Note: this command installs the bleeding edge package plexmediaserver-plexpass which may require an active PlexPass account. To install the stable version of Plex Media Server, install the plexmediaserver package instead.

$ pkg install plexmediaserver-plexpass

Start the Plex Media Server service and enable it at boot.

Note: if you installed the stable version of Plex Media Server, replace plexmediaserver_plexpass with plexmediaserver in the commands below.

$ sysrc plexmediaserver_plexpass_enable=YES
$ service plexmediaserver_plexpass start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment