How to install the graphical interface in Linux

How to install the graphical interface in Linux

1. Linux installation (root user operation)

1. Install vncserver;

yum install tigervnc-server

2. Install vncviewer;

yum install vnc

3. Stop and disable the firewall;

systemctl stop firewalld.service
systemctl disable firewalld.service

4. Install Linux graphical desktop

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

2. Configuration

1. Modify the startup file

vim /root/.vnc/xstartup

Fill it with the following content:

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1200x800"
gnome-session &

Indicates that the window is based on the geome desktop configuration

2. Create a new configuration file, taking window No. 1 as an example (you can also open multiple windows at the same time, just change the number), the method is as follows:

cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:1.service

Or add another window:

cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:2.service

Edit /lib/systemd/system/vncserver@:1.service and set the user root related parameters. The final content is as follows:

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target
#Start window 1
vncserver :1
# View the startup list status vncserver -list

The result of a successful startup should be as follows:

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/eunke-network002:1.log

View the log to obtain the port number:

cat /root/.vnc/eunke-network002:1.log 

If the startup fails, enter the folder, delete the X1 file, and restart Window 1:

cd /tmp/.X11-unix
rm -rf X1
# Kill window 1
vncserver -kill :1
#Start window 1
vncserver :1

4. Install VNC viewer on Windows

1. 64bit download address: https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.19.923-Windows-64bit.exe

2. After installation, enter IP: port as follows:

After pressing Enter, the remote Linux desktop will be opened.

Summarize

The above is the operation method of installing the graphical interface of Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to modify the root password in Linux Fedora 24 if you forget the password using the graphical interface
  • Detailed explanation of configuring XManager5 to connect to Linux graphical interface
  • Ubuntu graphical LAMP environment configuration tutorial (linux)
  • How to modify the output effect of Linux shell (interface color)
  • Linux redhat login interface switch

<<:  Problems and solutions of using jsx syntax in React-vscode

>>:  About React Native unable to link to the simulator

Recommend

mysql5.6.8 source code installation process

Kernel: [root@opop ~]# cat /etc/centos-release Ce...

How to modify the root password of mysql under Linux

Preface The service has been deployed on MySQL fo...

Some front-end basics (html, css) encountered in practice

1. The div css mouse hand shape is cursor:pointer;...

Eight rules for effective web forms

If you're collecting information from your us...

Sharing of web color contrast and harmony techniques

Color contrast and harmony In contrasting conditi...

Native JS to achieve directory scrolling effects

Here is a text scrolling effect implemented with ...

HTML form tag tutorial (2):

This tutorial introduces the application of vario...

JavaScript to achieve the idea of ​​​​snake game

The implementation idea of ​​the javascript game ...

The front-end page pop-up mask prohibits page scrolling

A problem that front-end developers often encount...

select the best presets to create full compatibility with all browsersselect

We know that the properties of the select tag in e...

Form submission refresh page does not jump source code design

1. Design source code Copy code The code is as fol...

Summary of problems encountered in the implementation of Vue plug-ins

Table of contents Scene Introduction Plugin Imple...