轉載
原文地址:https://blog.csdn.net/star2523/article/details/81152890
由於ubuntu18.04使用的是Gnome作為默認桌面,目前我探索出了兩種方式來從Windows系統使用自帶的mstsc遠程桌面連接 Ubuntu18:
1、使用VNC的方式來連接:
可以參考網址:https://websiteforstudents.com/access-ubuntu-18-04-lts-beta-desktop-via-vnc-from-windows-machines/
https://www.linuxidc.com/Linux/2017-09/147112.htm
https://www.cnblogs.com/xuliangxing/p/7642650.html
這三個網址的內容,關鍵操作就是:
sudo apt-get install xrdp vnc4server xbase-clients dconf-editor
-
#安裝vnc4server
-
sudo apt-get install vnc4server tightvncserver
就可以使用Windows的遠程桌面連接中的 Session: vnc-any 來連接Ubuntu了:
2、使用xrdp服務和 Session: xorg 來連接Ubuntu:
參考文章:https://websiteforstudents.com/connect-to-ubuntu-16-04-17-10-18-04-desktop-via-remote-desktop-connection-rdp-with-xrdp/
和https://www.linuxidc.com/Linux/2015-05/117835.htm
關鍵步驟:
-
sudo apt install xrdp
-
sudo systemctl enable xrdp
-
#安裝xubuntu-desktop
-
sudo apt-get install xubuntu-desktop
-
其中當有gdm和lightm的選項時,默認選擇gdm3即可
-
-
#向xsession中寫入xfce4-session
-
echo “xfce4-session” >~/.xsession
-
-
-
再設置配置文件
-
-
sudo gedit /etc/xrdp/startwm.sh
-
-
在. /etc/X11/Xsession 前一行插入
-
xfce4-session
-
或者將/etc/xrdp/startwm.sh 之中的unity全部更換為 xfce4-session
-
-
重啟xrdp
-
sudo service xrdp restart
-
-
最后就可以使用Windows的mstsc遠程桌面連接中的 Session: xorg Session 來連接Ubuntu了:
這樣兩個界面都可以遠程了:
其中xubuntu的命令行需要在桌面上點擊右鍵打開 Run Programma 來輸入 xfce4-terminal 才能打開終端:
但是上面兩種方法在性能速度上面還是有些慢,最好的方法是盡量使用SSH來輸入命令行,不得已的時候再用上面的方法:
sudo apt-get install openssh-server
打開"終端窗口",輸入"sudo ps -e |grep ssh"-->回車-->有sshd,說明ssh服務已經啟動,如果沒有啟動,輸入"sudo service ssh start"-->回車-->ssh服務就會啟動。