0% found this document useful (0 votes)
47 views

Vagrant - Enabling A CentOS VM's Gui Mode - CodingBee

This document provides instructions for enabling the GUI mode on a CentOS 7 VM created with Vagrant. It describes initializing the VM with CentOS/7, configuring Vagrant to enable the GUI, logging into the VM as root, installing GUI packages, uninstalling initial setup packages, switching to the graphical target, and restarting the VM if needed to display the GUI desktop. The full tutorial is provided to allow accessing the GUI interface on most Vagrant boxes that come without a desktop environment pre-installed.

Uploaded by

adhi_naren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Vagrant - Enabling A CentOS VM's Gui Mode - CodingBee

This document provides instructions for enabling the GUI mode on a CentOS 7 VM created with Vagrant. It describes initializing the VM with CentOS/7, configuring Vagrant to enable the GUI, logging into the VM as root, installing GUI packages, uninstalling initial setup packages, switching to the graphical target, and restarting the VM if needed to display the GUI desktop. The full tutorial is provided to allow accessing the GUI interface on most Vagrant boxes that come without a desktop environment pre-installed.

Uploaded by

adhi_naren
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CodingBee

Immutable Cloud Infrastructure one container at a time


 

Vagrant

Vagrant – Enabling a CentOS VM’s 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:

Announcement
I have released my new course on Udemy, Kubernetes By Example. Sign up
now to get free lifetime access!

$ vagrant init centos/7

The above command will create a Vagrantfile.

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

config.vm.provider "virtualbox" do |v|


v.gui = true
v.memory = 2048
v.cpus = 2
end

Log into your vm:

$ vagrant ssh

Then switch to root:


$ sudo -i

Then install the gui desktop collection of packages:

$ yum groupinstall -y 'gnome desktop'


$ yum install -y 'xorg*'

Next uninstall the following packages:

yum remove -y initial-setup initial-setup-gui

These packages are to do with agreeing to EULA agreements, which means it


requires user interaction, which can prevent automated startups via vagrant.

Next switch to the gui target:

$ systemctl isolate graphical.target


$ systemctl set-default graphical.target # to make this persistant

You should now see the gui desktop in your virtualbox window. If not, then try
restarting the box:

$ vagrant halt ; vagrant up

I’ve also created the vagrant enable gui shell script that you can copy into your
vagrant projects.

 PREVIOUS
Vagrant – Installing Vagrant on Windows
NEXT
Vagrant – Plugins 

SEARCH

You might also like