How do I install a Vagrant Linux box with a GUI (gnome, kde, ...)?
2 answers
This question is a duplicate with the broad answer here: Using Vagrants to Start Virtual Machines Using the Desktop Environment
Yes, you need to include the GUI in your roaming file, but first you need to:
- Installing add-ons for the Virtual Box guest application
- Installing the desktop environment
From one answer in the link above ( fooobar.com/questions/53746 / ... ) 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
+4
source to share
If you want to enter the desktop GUI, you can modify the Vagrantfile to add vb.gui = true
. For example:
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
Then you can vagrant up
and enter it from virtualbox.
+2
source to share