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

Summary of some tips for bypassing nodejs code execution

Table of contents 1. child_process 2. Command exe...

Introduction to Jenkins and how to deploy Jenkins with Docker

1. Related concepts 1.1 Jenkins Concepts: Jenkins...

Solution to prevent caching in pages

Solution: Add the following code in <head>: ...

Detailed example of jQuery's chain programming style

The implementation principle of chain programming...

js implements a simple English-Chinese dictionary

This article shares the specific code of js to im...

js Promise concurrent control method

Table of contents question background Idea & ...

How to upload projects to Code Cloud in Linux system

Create a new project test1 on Code Cloud Enter th...

Analysis of a MySQL deadlock scenario example

Preface Recently I encountered a deadlock problem...

Detailed configuration of Nginx supporting both Http and Https

It is almost a standard feature for websites nowa...

How to configure Bash environment variables in Linux

Shell is a program written in C language, which i...

Detailed explanation of the interaction between React Native and IOS

Table of contents Prerequisites RN passes value t...