# Experiments with FreeBSD on Intel Compute Stick ## Ingredients Acquire an Intel Compute Stick with Atom CPU and 2GB of RAM, 32GB of storage. The product code I got is BOXSTCK1A32WFC. You'll also need: - a USB hub - a USB thumbdrive with FreeBSD 11.0-CURRENT (10.2-RELEASE UEFI memstick crashes) - a USB keyboard & mouse - a USB nic/wifi adapter We won't be installing FreeBSD because the internal disk can't be detected but we can run the LiveCD image from the thumbdrive. Also the internal wifi adapater is not detected which is why I suggest a USB nic/wifi adapter. ## Test Device Boot into default OS and make sure everything works. In my case it was "Windows 8.1 with Bing". I sped through the default OS OOBE and just made sure everything worked fine to rule out faulty hardware. ## Create Medusa (Connect USB Peripherals) Since the Intel Compute Stick only has 1 USB port, connect the USB hub, and everything else to the hub. ## Boot into the BIOS (pressing F2) ![image of Mr Bean tapping piano key](http://i.imgur.com/uzjIGfi.gif) ## Change BIOS setting In the BIOS, under __Configuration__, change __Select Operating System__ from __Windows 32bit__ to __Ubuntu 64bit__. __Save Changes and Exit__. ## Boot from USB thumbdrive (pressing F10). ![image of Mr Bean tapping piano key](http://i.imgur.com/uzjIGfi.gif) Select your USB thumbdrive ## Select LiveCD Login with `root` and no password. Check what network adapters you have with `ifconfig`. You'll notice there is only `lo0`. Check what disk you have with `gpart show`. You'll notice there is only `da0` which is your USB thumbdrive. ## Let's increase the size of `/tmp` and `/var` so we can play with `pkg` Remount the `/` as read-write: `mount -o rw /` Set the tmpsize variable in `rc.conf` with: `sysrc tmpsize=300m` Set the varsize varialbe in `rc.conf` with: `sysrc varsize=300m` My USB wifi adapter used the realtek drivers which I had to read and accept by setting a variabl in `/boot/loader.conf` Now `reboot` ## Enable wifi from a USB adapter Where `rsu0` is your real wifi adapter name detected by FreeBSD: `ifconfig wlan0 create wlandev rsu0` Scan available wifi ssid networks with: `ifconfig wlan0 up scan` Create a file `/etc/wpa.conf` to save your wifi settings: ``` network={ ssid="$SSID" psk="$PASSWORD" } ``` Tell your `wlan0` which ssid to connect to: `ifconfig wlan0 ssid $SSID` Use `wpa_supplicant` to negotiate the password: `wpa_supplicant -iwlan0 -c/etc/wpa.conf &` Get an IP address from your router: `dhclient wlan0` ## We're going to temporarily link `/usr/local` to `/var/usrlocal` since we're only playing around % __DO NOT DO THIS ON A PRODUCTION SYSTEM__ % ``` mount -o rw / mkdir /var/usrlocal rmdir /usr/local ln -s /var/usrlocal /usr/local ``` ## Now let's use `pkg` to download and install some programs Bootstrap `pkg`: `env ASSUME_ALWAYS_YES=yes pkg bootstrap` Install `screenfetch`: `pkg install -y screenfetch` Mount the fdescfs needed by screenfetch: `mount -t fdescfs fdesc /dev/fd` Run it: `screenfetch`