summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--20220408-remote-desktop-vnc-openbsd.md29
-rw-r--r--Makefile8
-rw-r--r--static/passthrough/20220408-openbox-vnc.pngbin0 -> 172218 bytes
-rw-r--r--template/header.html1
-rw-r--r--template/index.html1
5 files changed, 38 insertions, 1 deletions
diff --git a/20220408-remote-desktop-vnc-openbsd.md b/20220408-remote-desktop-vnc-openbsd.md
new file mode 100644
index 0000000..65cd2db
--- /dev/null
+++ b/20220408-remote-desktop-vnc-openbsd.md
@@ -0,0 +1,29 @@
+# Remote X11 desktop with x11vnc on OpenBSD
+
+April 8, 2022
+
+Here are a few quick instructions on how to setup a VNC server on OpenBSD. This can give you remote X11 access to your OpenBSD machine if you can run an SSH client and VNC client.
+
+If you selected the default sets during your OpenBSD install, the X11 server is already installed, if not, you should install it now. We'll just need to install a VNC server through the packages, I've settled on `x11vnc`:
+
+ # pkg_add x11vnc
+
+Setting up `x11vnc` is pretty simple, you just need to give it command line options when starting the daemon. This is very simple with OpenBSD, just add your options to the `/etc/rc.conf.local` file. Here is an example configuration:
+
+ x11vnc_flags="-listen localhost -rfbauth /etc/x11vnc.passwd -logfile /var/log/x11vnc -ncache 0 -display :0 -forever -loop100 -auth /etc/X11/xenodm/authdir/authfiles/A:0-*"
+
+I won't explain all the options here, you should read `x11vnc(1)` and/or the [doc](https://github.com/LibVNC/x11vnc/tree/master/doc/OPTIONS.md) for more details. Nonetheless, the first two options are worth explaining. The VNC server is listening on localhost because the VNC protocol is not encrypted by default, so we will tunnel the VNC connection through SSH. Next, we specify a file containing the password to allow connecting. This file can be created with the following command, of course you should not use `verysecurepassword`:
+
+ # x11vnc -storepasswd verysecurepassword /etc/x11vnc.passwd
+
+According to the man page, this file is not encrypted and just obfuscated with a fixed private key, so you should restrict the permissions on this file. Anyway the server is ready to be started:
+
+ # rcctl start x11vnc
+
+You should now be able to connect to the server, after setting up the port forwarding with SSH, as such for example:
+
+ $ ssh -L 5900:localhost:5900 myserver
+
+This basically forwards port 5900 of `myserver` to port 5900 on `localhost`. To connect to the VNC server, simply use `localhost` as the server and port 5900. If issues may arise, read the log and `x11vnc(1)`. I've been using this setup for a few weeks now and I'm quite happy with it. As a bonus, here is a screenshot of my openbox VNC session:
+
+[![openbox session screenshot](/static/20220408-openbox-vnc.png)](/static/20220408-openbox-vnc.png)
diff --git a/Makefile b/Makefile
index 7f94b50..a1e6d09 100644
--- a/Makefile
+++ b/Makefile
@@ -26,13 +26,16 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-MD=markdown_py
+MD=Markdown.pl
.SUFFIXES: .md .html
articles!=ls *.md
articles_html = ${articles:.md=.html}
site : index about $(articles_html)
+ @echo "Copying static resources"
@cp static/favicon.ico output/
+ @mkdir -p output/static
+ @cp static/passthrough/* output/static
@echo "done"
index :
@@ -69,5 +72,8 @@ about :
clean :
rm -rf output/*
+serve :
+ python3 -m http.server 8080 --directory output/
+
upload :
rsync -avc --delete output/ vincent@blog.vdouillet.fr:/var/www/htdocs/blog/
diff --git a/static/passthrough/20220408-openbox-vnc.png b/static/passthrough/20220408-openbox-vnc.png
new file mode 100644
index 0000000..7570671
--- /dev/null
+++ b/static/passthrough/20220408-openbox-vnc.png
Binary files differ
diff --git a/template/header.html b/template/header.html
index 19342a0..463b778 100644
--- a/template/header.html
+++ b/template/header.html
@@ -24,4 +24,5 @@
body{max-width:none;font-size:1em}
.noprint{display:none}
}
+ article > p > a > img{width:100%}
</style>
diff --git a/template/index.html b/template/index.html
index bfe1927..0a989c3 100644
--- a/template/index.html
+++ b/template/index.html
@@ -2,6 +2,7 @@
<p>Hello and welcome, my name is Vincent and you've landed on the small space where I ramble mainly about IT and occasionally other topics. You can check my articles below, my <a href="//git.vdouillet.fr" title="git.vdouillet.fr">git repos</a> or the <a href="/about.html" title="about">about</a> page.</p>
</header>
<ul style="list-style-type:none;padding-left:0">
+ <li><a href="/remote-desktop-vnc-openbsd.html" title="Remote X11 desktop with x11vnc on OpenBSD">04-08-2022 Remote X11 desktop with x11vnc on OpenBSD</a></li>
<li><a href="/advent-of-code-2021.html" title="Advent of Code 2021">01-05-2022 Advent of Code 2021</a></li>
<li><a href="/lightweight-mail-client.html" title="On the status of lightweight GUI mail clients">11-03-2021 On the status of lightweight GUI mail clients</a></li>
<li><a href="/browsing-gems.html" title="Browsing gems">10-11-2021 Browsing gems</a></li>