Home > vagrant > Enable ssh X11 forwarding on Vagrant boxes

Enable ssh X11 forwarding on Vagrant boxes

I got the following error when trying to run tkinter on a vagrant box. (Ubuntu/trusty32).

TclError: no display name and no $DISPLAY environment variable

Forward X11 Display to the host machine.

Following the tutorial shown in the source section below, the minimum I needed to do was to add

config.ssh.forward_x11 = true

to the Vagrantfile.

$ less Vagrantfile
  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  config.vm.box = "ubuntu/trusty32"

  # Forward X11
   config.ssh.forward_x11 = true

Then, vagrant up, vagrant ssh, then tried to run the python code again. Code works as expected.


Categories: vagrant
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: