[ #69 ] Forwarding X Permalink

X, NetBSD, OSX Added a year and a bit ago and last edited a year and a bit ago

My host is Mac OS X, and my guest is a NetBSD VM running on the host. This will show you how I forward X apps from guest to the host.

Ensure host has X11

On Mac OS X you can install X11 from the OS install disk that came with your computer.

Start X11 on host

On Mac OS X, start /Applications/X11.app

Get display list on host

In the xterm that was opened up on Mac:

host$ xauth list
YourBox.local/unix:0  MIT-MAGIC-COOKIE-1  dfa82d25b775957b7571f76727e51f3c
10.1.1.2:0  MIT-MAGIC-COOKIE-1  dfa82d25b775957b7571f76727e51f3c

We are interested in the one that does not have "unix" in it, i.e. the second line. Copy this line, we will be using it below. (The above is an example, yours will look different.)

Ensure guest has X11Forwarding enabled

guest$ grep X11Forwarding /etc/ssh/sshd_config 
X11Forwarding yes

... change if it's not enabled, and remember to restart sshd.

SSH to guest

host$ ssh -X guest

... the X flag enables X11Forwarding over this ssh connection.

Export display

guest$ export DISPLAY=10.1.1.2:0  # use the IP:Number combination that you got from xauth list
guest$ xauth add 10.1.1.2:0  MIT-MAGIC-COOKIE-1  dfa82d25b775957b7571f76727e51f3c

Run an X App

guest$ xlogo

... and watch it appear on your host.

Colophon

Django Python 960.gs Git Vim NetBSD Nginx

The Author

This is the blog of Brad Willis, a software engineer living in Brisbane.

Meta

Help
Latest entries

*BSD Agile Apache Apple apt Athletics Best-Practice Censorship Comedy Cool Crosswords Deployment Django English Exim Firefox Git Hardcore Health irssi Javascript Jira Languages Linux Makefile Mathematics Mobile Broadband Mutt MySQL NetBSD nginx Nokia OpenVZ OSX Perl Privacy Python Rant Requirements rsync Ruby Shell Slackware SQL SQLite SSH Standards Subversion Television Testing ThisBlog Vim VMWare (Fusion) VPN X zsh

Recent Entries

Checking for exceptions in doctests
Homer's Curling Speech
retry in Python
Vim Makefile tabs
Centos (or RH) IPTables
Converting ssh2 public keys to openssh
Vim comment hints
Context managers in Perl
Dish rotation
Git - fixing commit user
apt stuff
Using shell variables in AWK
Linux - Too many open files
Tell gvim to save and quit... remotely
Vim - automatically remove whitespace at EOL
Python - relative paths from within modules
TV Aspect Ratios
Git - Which commits are in your branch only?
Subversion setup cheat sheet
Force detach a screen session
Modify sudo's use of environment variables
Install all Perl modules
Mutt - delete old messages
OpenVZ VPS and swap space
fail2ban on NetBSD for ssh
NetBSD - Using sup
Python - testing for a sys.exit
Python Best Practice Link Dump
Python script names
Perl - Using an expensive module
Speed of git clone
Perl Modules with Custom Prefix
Perl: tr vs. s
Brilliant sysadmin Reference
Why is GRUB better than LILO?
Why is swap space important?
Perldoc Output
Git's Index
Jira Project Keys
Git GUI

Links

ChoppingBoard, DaveMisc, Project365, RageQuit