Running Xubuntu (with stereo audio support) on stock PocketBeagle

Looks like this is pretty easy to do.

If your host PC (the one that the pocketbeagle plugs into) is running Linux, it can host a PocketBeagle desktop.

Everything in the attachment was running on Pocketbeagle (which obviously has no video hardware) using the host screen.

The basic idea is to:

(1) start with Robert’s ubuntu 16.04 image. I installed it on a larger 25 GB card but probably not necessary. The final usage is still under 2GB.

(2) set up internet proxy so we can do some apt-get goodness

I set up this script on the Linux host laptop, also running 16.04:

sudo sysctl net.ipv4.ip_forward=1
sudo iptables --table nat --append POSTROUTING --out-interface enp4s0 -j MASQUERADE
sudo sudo iptables --table nat --append POSTROUTING --out-interface enp4s0 -j MASQUERADE
sudo sudo iptables --append FORWARD --in-interface enx60640542f439 -j ACCEPT
echo “on tethered device:”
echo “sudo route add default gw”
echo “nameserver in resolv.conf”

Its possible that your internet connection is not on device ‘enp4s0’, substitute the name from running ifconfig
Also, its possible that your pocketbeagle isnt the exact same ‘in-interface’ name, substitute the name from running ifconfig

Then, login to pocketbeagle using ssh:

$ ssh ubuntu@
and do the two things echo’d above (have to automate this!)

$ sudo route add default gw
$ vi /etc/resolv.conf and replace the nameserver to

Check that is working on the pocketbeagle:

$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=59 time=18.6 ms
64 bytes from icmp_seq=2 ttl=59 time=10.6 ms

$ ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=53 time=25.0 ms
64 bytes from ( icmp_seq=2 ttl=53 time=26.7 ms

(3) Now you can do the xfce4 apt-get on pocketbeagle:

$ sudo apt-get update
$ sudo apt-get install xfce4

This takes a while and may warrant a reboot afterward. Note that any reboot requires adding the default gw and resolv.conf edits since they are lost. Same thing goes for your host proxy script if you reboot that.

(4) To check that your host can display X windows, I’d login to pocket beagle using ssh -X (from the host) and launch xterm as shown:

$ ssh -X ubuntu@
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.91-ti-r136 armv7l)

p.s. I’m pretty sure I didnt need to set DISPLAY or xhost+ back on the host owing to the ssh -X

(5) try launching xfce4 (no need to do this from the xterm, you can close that out)

ubuntu@arm:~$ startxfce4

You should get the xfce4 desktop

(6) to get audio to work, logout, go back to the host and enable “Enable network access to local sound devices” in the “Network Server” tab of ‘paprefs’. You may need to install it (on the host):

$ apt-get install paprefs
$ paprefs

I think that requires a reboot of the host (which means you have to set up the proxy stuff in step #2 again if you want access to the internet).

Then put this script on the pocketbeagle (I called it and put it in the ubuntu root directory so it can be launched remotely):

startxfce4 &

You can launch it from within an ssh -X session, but this is nicer –

From the host, just reference it in the ssh -X:

$ ssh -X ubuntu@ ./

That sets up X forwarding back to the host and launches the desktop and sets up the PULSE_SERVER environment variable.

Now, within the desktop, you can check the pulse audio config by trying to see the media volume control (its in the upper right corner of the attachment).

Now you are home free, just install your favorite apps.

I installed:

$ sudo apt-get install midori
$ sudo apt-get install sox
$ sudo apt-get install alsa-utils
$ sudo apt-get install vlc
$ sudo apt-get install mousepad

vlc is all you need to play audio, but play (in sox) is a command line thing. aplay is in alsa-utils. mousepad is a text editor. Theoretically, system sounds will work too.

The basic desktop ‘only’ takes 57 MB, leaving plenty of room for the other stuff to run, although the browser (midori) is a bit slow.

KiB Mem : 499104 total, 294396 free, 57092 used, 147616 buff/cache

As mentioned, the SD card has plenty of room:

Filesystem Size Used Avail Use% Mounted on
/dev/root 30G 1.5G 27G 6% /

Obviously, hooking up the 2nd usb port may make a lot of this easier (permanent internet) and possibly just use a USB display device…

But we get all of this with no hardware. Just the stock pocketbeagle with stock usb connection.