云服务器配置远程桌面
租赁云服务器通常没有图形化界面因为想跑仿真看场景所以希望通过远程桌面的方式链接过去那就需要服务器有图形化界面1.安装图形化界面ssh建立连接后sudo apt update极简版 sudo apt install --no-install-recommends task-gnome-desktop简化版 sudo apt install task-gnome-desktop 我用的完整版 sudo apt install -y ubuntu-desktop设置图形界面为默认启动sudo systemctl set-default graphical.target重启服务器sudo reboot查看图形化界面是否启动 systemctl status display-manager返回Active:active (running)启动成功2.安装远程桌面nomachine拉取安装包wgethttps://web9001.nomachine.com/download/9.4/Linux/nomachine_9.4.14_1_amd64.debnomachine下载页面https://download.nomachine.com/download/?id1platformlinux安装 sudo dpkg -i nomachine_9.4.14_1_amd64.deb修改nomachine的默认端口号为云服务提供的预留端口号打开配置文件 sudo nano /usr/NX/etc/server.cfg找到 #NXTCPPort 4000行和Port 4000行修改为 NXTCPPort *** 和 Port ***其中***是你自己云服务的预留内网端口号本地配置nomachine时使用对应的外网端口号ctro保存回车ctrx退出修改完配置文件需要重启nomachine服务sudo systemctl restart nxserver检查nomachine运行状态sudo systemctl status nxserver返回Active:active (running) 正在运行3 修改登录配置如果nomachine连接过去需要用户名密码登录可配置自动登录功能确认你的用户名 whoami如果输出为ubuntu编辑GDM3配置文件sudo nano /etc/gdm3/custom.conf找到以下部分[daemon]# AutomaticLoginEnable true# AutomaticLogin user1修改为[daemon]AutomaticLoginEnable trueAutomaticLogin ubuntu (你的用户名)重启服务sudo systemctl restart gdm34 解决root用户不能直接打开vs code和chrome的问题以下方法可以解决root用户不能直接打开应用的问题还是建议创建一个普通用户/usr/share/applications/vscode.desktop 文件中Exec/usr/share/code/code %F修改为Exec/usr/share/code/code --no-sandbox --user-data-dir/tmp/vscode %F/usr/share/applications/google-chrome.desktop文件中Exec/usr/bin/google-chrome-stable %U修改为Exec/usr/bin/google-chrome-stable --no-sandbox --user-data-dir/tmp/chrome %U
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2551523.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!