Enable CentOS gui in vagrant

from: http://codingbee.net/tutorials/vagrant-tutorials/vagrant-enabling-a-vms-gui-mode

Most vagrant boxes comes without the gui desktop interface. This tutorial will show you how install and access to that gui interface.

Let’s use the standard CentOS 7 vm:

$ vagrant init centos/7

The above command will create a Vagrantfile.

Next open up the vagrant file ensure the following virtualbox setting section exists:

config.vm.provider "virtualbox" do |v|
  v.gui = true
end

Log into your vm:

$ vagrant ssh

Then switch to root:

$ sudo -i

Then install the gui desktop collection of packages:

$ yum group install 'gnome desktop'

Next switch to the gui target:

$ systemctl isolate graphical.target

You should now see the gui desktop in your virtualbox window.

Finally enable the graphical target, so that the graphical mode starts up by default on the next reboot.

$  systemctl set-default graphical.target
Advertisements

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