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

We understand that Michael Dexter, Brad Davis, and George Rosamond think 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 267: Absolute FreeBSD

2018-10-10

Direct Download:MP3 AudioVideo Headlines Interview - Michael W. Lucas - mwlucas@michaelwlucas.com / @mwlauthor BR: [Welcome Back] AJ: What have you been doing since last we talked to you [ed, ssh, and af3e] BR: Tell us more about AF3e AJ: How did the first Absolute FreeBSD come about? BR: Do you have anything special planned for MeetBSD? AJ: What...

Episode 266: File type history

2018-10-03

Direct Download:MP3 AudioVideo Headlines OpenBSD/NetBSD on FreeBSD using grub2-bhyve When I was writing a blog post about the process title, I needed a couple of virtual machines with OpenBSD, NetBSD, and Ubuntu. Before that day I mainly used FreeBSD and Windows with bhyve. I spent some time trying to set up...

Episode 265: Software Disenchantment

2018-09-26

Direct Download:MP3 AudioVideo Headlines [FreeBSD DevSummit & EuroBSDcon 2018 in Romania] Your hosts are back from EuroBSDcon 2018 held in Bucharest, Romania this year. The first two days of the conference are used for tutorials and devsummits (FreeBSD and NetBSD), while the last two are for talks. Although Benedict organized the devsummit in large...

Episode 264: Optimized-out

2018-09-19

Direct Download:MP3 AudioVideo This episode was brought to you by Headlines FreeBSD & DragonFlyBSD Put Up A Strong Fight On AMD's Threadripper 2990WX, Benchmarks Against Linux The past two weeks I have been delivering a great deal of AMD Threadripper 2990WX benchmarks on Linux as well as some against Windows and Windows...