Home > vagrant > Enable ssh X11 forwarding on Vagrant boxes

Enable ssh X11 forwarding on Vagrant boxes

Problem:
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

Solution:
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.

Source
http://computingforgeeks.com/how-to-enable-and-use-ssh-x11-forwarding-on-vagrant-instances/
https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html

Advertisements
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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: