How to install wine on linux ubuntu with X11 forwarding via vagrant

The following code should go into a bash file on the linux image that vagrant is running.

1
2
3
4
5
6
7
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
yes Y | udo apt-get install ttf-mscorefonts-installer
sudo dpkg --add-architecture i386
sudo apt-get update
yes Y | sudo apt-get install wine
yes Y | sudo apt-get install winetricks
yes Y | sudo apt-get install xauth

You need to add the following 2 lines to the vagrant config file ( Vagrantfile )

1
2
<strong>config.ssh.forward_agent = true
config.ssh.forward_x11 = true</strong>
1
2
3
4
5
6
7
8
9
10
11
12
13
# config.vm.provider "virtualbox" do |vb|
#   # Display the VirtualBox GUI when booting the machine
#   vb.gui = true
#
#   # Customize the amount of memory on the VM:
#   vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
<strong>
config.ssh.forward_agent=true
config.ssh.forward_x11=true</strong>

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision “shell”, inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL

ssh into the box using the following command

1
vagrant ssh

check that wine and x11 forwarding is working by running the following command

1
ubuntu@ubuntu-xenial:~$ wine notepad