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 232: FOSDEM 2018

2018-02-07

Direct Download:HD VideoMP3 AudioTorrent> This episode was brought to you by Headlines [FOSDEM Trip report] Your BSDNow hosts were both at FOSDEM in Brussels, Belgium over the weekend. On the friday before FOSDEM, we held a FreeBSD devsummit (3rd consecutive year), sponsored by the FreeBSD Foundation and organized by Benedict (with the help from Kristof...

Episode 231: Unix Architecture Evolution

2018-01-24

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines Unix Architecture Evolution from the 1970 PDP-7 to the 2017 FreeBSD Q: Could you briefly introduce yourself? I’m a professor of software engineering, a programmer at heart, and a technology author. Currently I’m also the editor in chief of the IEEE...

Episode 230: Your questions, Part III

2018-01-24

Direct Download:HD VideoMP3 AudioTorrent> This episode was brought to you by Headlines KPTI patch lands in FreeBSD -current After a heroic effort by Konstantin Belousov kib@FreeBSD.org, the first meltdown patch has landed in FreeBSD This creates separate page tables for the Kernel and userland, and switches between them when executions enters the kernel, and when...

Episode 229: The Meltdown of Spectre

2018-01-17

Direct Download:HD VideoMP3 AudioTorrent> This episode was brought to you by Headlines More Meltdown Much has been happened this week, but before we get into a status update of the various mitigations on the other BSDs, some important updates: Intel has recalled the microcode update they issued on January 8th. It turns out this update...