Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install a Vagrant Linux box that has a GUI (gnome, kde, ...)?

How do I install a Vagrant Linux box that has a Desktop GUI (gnome, kde, ...).

Is there a Vagrant box distribution that already has a Desktop environment?

After I do a "vagrant up" how do I log into this virtual box and with the GUI active?

like image 920
Ken Avatar asked Dec 15 '22 12:12

Ken


1 Answers

This question is a duplicate with an extensive answer here: Using vagrant to run virtual machines with desktop environment

Yes, you need to enable the GUI in your vagrant file, but first you need to:

  • Install Virtual Box Guest additions
  • Install your desktop environment

From one of the answer in the link above (https://stackoverflow.com/a/33138627/1412348), you can use the following vagrant file:

Vagrant.configure(2) do |config|
  # Ubuntu 15.10
  config.vm.box = "ubuntu/wily64"

  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true
  end

  # Install xfce and virtualbox additions
  config.vm.provision "shell", inline: "sudo apt-get update"
  config.vm.provision "shell", inline: "sudo apt-get install -y xfce4 virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11"
  # Permit anyone to start the GUI
  config.vm.provision "shell", inline: "sudo sed -i 's/allowed_users=.*$/allowed_users=anybody/' /etc/X11/Xwrapper.config"
end
like image 122
AntonyG Avatar answered Dec 17 '22 03:12

AntonyG