Question

I've set up a Vagrant VM with X forwarding. I'm connecting to it with the following command (to improve X performance):

ssh -c arcfour,blowfish-cbc -XC vagrant@VM-NAME

This works fine; I log into the VM and whenever I launch an X Windows application it is rendered in my local X client.

However, after around 15 - 30 minutes use, I start getting the following error when launching X Windows applications:

vagrant@VM-NAME:~/$ firefox
Error: cannot open display: localhost:10.0

This persists until I disconnect my SSH connection and reconnect. Oddly, any X Windows applications I've already launched keep running normally.

The error happens regardless of whether I'm using tmux or not. My system details are as follows:

Host

Mac OS X 10.7.5
VirtualBox 4.2.6 r82870

Client

Ubuntu 12.04 (precise)
Kernel 3.2.0-35-generic (#55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012)
Xorg 1.11.3 (29 August 2012  12:12:33AM)

I've installed the full ubuntu-desktop package on the VM.

Any ideas on how to fix this? I've found plenty of documentation and issue reports surrounding X forwarding not working at all, but nothing relating to eventual failure.

N.B: I have upgraded my SSH client and XQuartz to the very latest versions but the problem persists. It does not happen, however, if I use the regular vagrant ssh command to connect to the VM.

Was it helpful?

Solution

Perhaps you've hit this issue:

why does ssh X forwarding timeout after a while?

Use -Y instead of -X to enable trusted x clients. Security concerns should be minimal since you're running vagrant on the same box.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top