How do I turn off the Gnome interface for VNC in CentOS?

Post Reply
User avatar
Edge100x
Founder
Founder
Posts: 12945
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

How do I turn off the Gnome interface for VNC in CentOS?

Post by Edge100x »

CentOS 5.x installs for virtual machines are configured to start Gnome by default when the machine boots. You won't see this graphical interface if you log in through SSH, but it will be running in the background, and you can log in through VNC to interact with it.

If you would prefer that it not start when the machine boots -- perhaps because you never use it and want to save the resources -- you'll need to edit the /etc/inittab file and change the default runlevel:

1. Log in to your server through SSH (instructions for this are on the "Server control" page of its control panel).
2. Type this command and hit enter:

Code: Select all

nano /etc/inittab
3. Cursor down to this line:

Code: Select all

id:5:initdefault:
... and change the "5" to a "3" so it looks like this:

Code: Select all

id:3:initdefault:
4. Hit Control-X. The text editor will ask you if you want to save the modified buffer; hit "y".

The next time you reboot your machine (such as through the "reboot" command), you will see a normal login prompt in VNC instead of the Gnome GUI.
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: How do I turn off the Gnome interface for VNC in CentOS?

Post by Edge100x »

If you have a CentOS 6+ server, it will not come with Gnome installed by default. While we do not recommend running a desktop for performance reasons, you can add and enable it with these commands:

Code: Select all

yum groupinstall "X Window System"
yum install gnome-classic-session gnome-terminal 
yum install nautilus-open-terminal control-center liberation-mono-fonts
rm /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
After doing this, rebooting the system will activate your new desktop.
Post Reply