Two ways to Linux Remote Desktop

Source: Internet
Author: User

In most cases, Linux does not need to use the GUI's desktop environment, but sometimes in special scenarios such as installing Oracle, a graphical interface is required to assist in the installation.

If you want to use the graphical interface of Linux, there are generally two ways:

1, Linux system installation x Windows graphics interface, using VNC remote.

2, Linux system enable x protocol, configure X clent, local desktop environment of the machine (such as Windows) configuration x server, get remote information, display the graphical interface on the local x Server.


Method One:

Native installation Graphical interface

Here CentOS6.5 machine For example, the installation of the graphical interface is relatively simple, using Yum.

Yum Groupinstall "X Window System" Yum groupinstall "Desktop" Yum Groupinstall "Font"

Then execute:

startx# or execute init 5

If you want to load the graphical interface automatically when you start, modify the default configuration for the last line of/etc/inittab:

Vi/etc/inittabid:5:initdefault: # 5 is in graphical mode, 3 is the default character mode


If the system is CentOS7:

Yum Group List #列出可用的GUI软件包yum Group install "GNOME Desktop" "Graphical administration Tools"

Modify the default run mode (7 and 6 are not the same):

unlink/etc/systemd/system/default.targetln-sf/lib/systemd/system/runlevel5.target/etc/systemd/system/ Default.targetreboot

Configuring VNC

To install VNC:

Yum Install Tigervnc tigervnc-server-y

To modify the configuration:

Vi/etc/sysconfig/vncservers
vncservers= "2:root" vncserverargs[2]= "-geometry 800x600-nolisten tcp-localhost"

To set the VNC password:

vncpasswd

Start Vncserver:

Vncserver &

This allows you to remotely connect to the Linux graphical interface using Vncview on-premises.


Method Two:

Installing a graphical interface on a Linux server is not a desirable approach, which can degrade the performance of the server, so here's a look at the second approach.

You need to install X server on the local computer first, you can use the popular xming can also use VCXSRV, both are open source products, of course, if there is xmanager can also achieve the same function.

Here I install the VCXSRV, using the default installation method.

Download Link: https://sourceforge.net/projects/vcxsrv/Configure local settings, Default-1 to 0.0


Server configuration, install x clent Some of the drive packages and applications, easy to test, where the package is very small:

Yum Install Xorg-x11-xauthyum install xclock xhost xtermyum install Xdpyinfo #如果是安装oracle需要安装此包

To modify the SSH configuration/etc/ssh/sshd_config:

Allowtcpforwarding yesx11forwarding Yesx11uselocalhost Yes

Restart sshd.

To configure SSH, take Xshell as an example,

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M01/00/CC/wKiom1mdYfWB6GZiAAF9es2q9nk043.jpg "title=" 1111. JPG "alt=" wkiom1mdyfwb6gziaaf9es2q9nk043.jpg "/>

If you have Xmanager you can choose to use Xmanager directly.


Using reconnect, configure the environment variable (here is the IP of the x server, which is the IP of the local computer, configured to be unified with Xshell):

Export Display=192.168.20.171:0.0xhost +access control disabled, clients can connect from the any host #出现此输出表示配置成功.

To perform the test:

# xclock warning:missing charsets in String to Fontset conversion

If this happens, a local image of the clock indicates that the configuration was successful.

What's the use of this one, for example:

If you remotely install Oracle locally, after entering the installation script, you will automatically jump out of the graphical interface locally.

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M01/00/CC/wKiom1mdZMSj8OQ5AAFEOf8Bp9U366.jpg "title=" 1111. JPG "alt=" wkiom1mdzmsj8oq5aafeof8bp9u366.jpg "/>

650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M02/9F/7C/wKioL1mdZeLDaKq4AAG2r7pS2Nc179.jpg "title=" 1111. JPG "alt=" wkiol1mdzeldakq4aag2r7ps2nc179.jpg "/> This is a magical process.



Reference Links:

https://www.centos.org/forums/viewtopic.php?t=47088

This article is from the "Trying" blog, make sure to keep this source http://tryingstuff.blog.51cto.com/4603492/1958772

Two ways to Linux Remote Desktop

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.