如何在Windows上远程连接Linux桌面,并且手动切换多个桌面(如果安装了多个桌面的话)
How to Remotely Access Linux From Windows
原文链接 http://sigkillit.com/tag/xrdp/
There are many ways to remotely access Linux including VNC, SSH, FreeNX, NXFree, Hamachi, Teamviewer, and the list goes on. When it comes to remote access a few questions come to mind… Is it secure, is it GUI or Command Line, how’s the performance, what extra software is required, etc. If you are connecting to your Fedora 18 install from Windows there’s a great solution called xRDP. xRDP uses the Windows Remote Desktop protocol to present an X window’s desktop to the user. The Windows Remote Desktop offers a secure connection to your Linux box, similar to VNC over SSH. In addition, it does not require any additional software on your Windows machine since the Remote Desktop Client is built in. If you are running Linux, you can remote into the server using RDesktop (Included in Fedora 18).
如果没有安装图形界面:
以centos7为例,先看是否安装了epel(没有就输入yum install epel-release装)
尝试yum grouplist查看可以安装哪些桌面,然后装GNOME Desktop桌面就输
yum groupinstall "GNOME Desktop"
还想装KDE桌面就输(装一个就够了其实)
yum groupinstall "KDE Plasma Workspaces"
然后:
Install xRDP
Install xRDP
1 |
sudo yum install xrdp |
Start the xRDP Service and Set It to Start at Boot
Start the xRDP Service and Set It to Start at Boot
1运行服务 2让服务自启动 |
systemctl start xrdp.service systemctl enable xrdp.service |
Add RDP Exception to the Firewall(有防火墙给开端口,没有跳过)
Add RDP Exception to the Firewall
1 2 |
firewall-cmd --add-port=3389/tcp firewall-cmd --permanent --add-port=3389/tcp |
Open the Windows RDP Client and Connect to Linux
(如果安装了多个桌面,想切换的话)Customize Desktop Environment for xRDP Session
If you do not want to use the default desktop environment, you can customize it by creating a .Xclients file (X is capital!!!) in your home directory to launch the desktop environment you want and making it executable. In order to do this, open a terminal and run one of the following commands
Gnome 3
Gnome 3
1 2 3 |
sudo echo "gnome-session" > ~/.Xclients sudo chmod +x ~/.Xclients sudo systemctl restart xrdp.service |
Gnome Fallback
Gnome Fallback
1 2 3 |
sudo echo "gnome-fallback" > ~/.Xclients sudo chmod +x ~/.Xclients sudo systemctl restart xrdp.service |
KDE
KDE
1 2 3 |
sudo echo "startkde" > ~/.Xclients sudo chmod +x ~/.Xclients sudo systemctl restart xrdp.service |
MATE
MATE
1 2 3 |
sudo echo "mate-session" > ~/.Xclients sudo chmod +x ~/.Xclients sudo systemctl restart xrdp.service |
Cinnamon
Cinnamon
1 2 3 |
sudo echo "cinnamon" > ~/.Xclients sudo chmod +x ~/.Xclients sudo systemctl restart xrdp.service |
Xfce4
Xfce4
1 2 3 |
sudo echo "startxfce4" > ~/.Xclients sudo chmod +x ~/.Xclients sudo systemctl restart xrdp.service |