Skip to main content.

Jailed VNC sessions

2013-10-09

Live demo in BSD Now Episode 006 | Originally written by TJ for bsdnow.tv | Last updated: 2013/10/09

NOTE: the author/maintainer of the tutorial(s) is no longer with the show, so the information below may be outdated or incorrect.

Have you ever needed to run a specific GUI application on your BSD system.. securely? Remotely? Well, if you follow this tutorial, you can! We'll be running a VNC server, patching it to work in a FreeBSD jail and only allowing VNC over a tunneled SSH connection. The patch has been submitted upstream but both the developers and port maintainers don’t seem to care about integrating it. I’m going to install X11, a light window manager (Openbox) and TightVNC. You can replace Openbox with whatever window manager you like. This assumes you already have a jail with an sshd running and the ports tree in place.

## If you don't have portmaster, install it from /usr/ports/ports-mgmt/portmaster

# portmaster -d --no-confirm x11/xorg x11-wm/openbox net/tightvnc
# fetch -o /tmp http://www.bsdnow.tv/patches/vncserver.patch
# sha256 -q /tmp/vncserver.patch

7233241911c254c75ac0b19b454fbad1a8837934023b31ca4df3b43da860448f

# cd /usr/local/bin
# patch < /tmp/vncserver.patch

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- vncserver  2013-10-09 16:10:25.000000000 +0000
|+++ vncserver.new      2013-10-09 16:12:45.000000000 +0000
--------------------------
Patching file vncserver using Plan A...
Hunk #1 succeeded at 296.
Hunk #2 succeeded at 304.
done

We'll add some items to start up automatically.

$ mkdir ~/.vnc
$ vi ~/.vnc/xstartup

Put your window manager and a terminal and whatever else:

#!/bin/sh
xrdb $HOME/.Xresources &
openbox &
xterm -bg black -fg gray &

Finally,

$ chmod +x ~/.vnc/xstartup
$ vncserver -depth 24 -geometry 1280x800 -nolisten tcp :1

Now, on the client PC we run:

$ ssh -v -N -L 5901:localhost:5901 you@your-server-ip

And use any VNC client to connect to localhost, port 5901.

Latest News

New announcement

2017-05-25

Hi, Mr. Dexter. Also, we understand that Brad Davis thinks there should be more real news....

Two Year Anniversary

2015-08-08

We're quickly approaching our two-year anniversary, which will be on episode 105. To celebrate, we've created a unique t-shirt design, available for purchase until the end of August. Shirts will be shipped out around September 1st. Most of the proceeds will support the show, and specifically allow us to buy...

New discussion segment

2015-01-17

We're thinking about adding a new segment to the show where we discuss a topic that the listeners suggest. It's meant to be informative like a tutorial, but more of a "free discussion" format. If you have any subjects you want us to explore, or even just a good name...

How did you get into BSD?

2014-11-26

We've got a fun idea for the holidays this year: just like we ask during the interviews, we want to hear how all the viewers and listeners first got into BSD. Email us your story, either written or a video version, and we'll read and play some of them for...


Episode 220: Opening ZFS in 2017

2017-11-15

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines The First PS4 Kernel Exploit: Adieu The First PS4 Kernel Exploit: Adieu Plenty of time has passed since we first demonstrated Linux running on the PS4. Now we will step back a bit and explain how we managed to jump...

Episode 219: We love the ARC

2017-11-08

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines Papers We Love: ARC: A Self-Tuning, Low Overhead Replacement Cache Ever wondered how the ZFS ARC (Adaptive Replacement Cache) works? How about if Bryan Cantrill presented the original paper on its design? Today is that day. Slides It starts by looking back at a fundamental paper...

Episode 218: A KRACK in the WiFi

2017-11-01

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines FreeBSD 10.4-RELEASE Available FreeBSD 10.4-RELEASE is out. The FreeBSD Project dedicates the FreeBSD 10.4-RELEASE to the memory of Andrey A. Chernov. Some of the highlights: 10.4-RELEASE is the first FreeBSD release to feature full support for eMMC storage, including eMMC partitions, TRIM...

Episode 217: Your questions, part II

2017-10-25

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines OpenBSD 6.2 Released OpenBSD continues their six month release cadence with the release of 6.2, the 44th release On a disappointing note, the song for 6.2 will not be released until December Highlights: Improved hardware support on modern platforms including ARM64/ARMv7 and octeon,...