Linux/ubuntu server 18.04 安装远程桌面--vnc server

易英奕
2023-12-01

此文首发于我的个人博客:Linux/ubuntu server 18.04 安装远程桌面–vnc server — zhang0peter的个人博客


想装桌面端在服务器上的原因是我在终端中开chrome会报错:

-> # xhost +
xhost:  unable to open display ""
-> # chromium-browser --no-sandbox   
(chromium-browser:31963): Gtk-WARNING **: 21:05:55.910: cannot open display: 

Python报错:

  File "/usr/local/lib/python3.6/dist-packages/pyppeteer/launcher.py", line 330, in launch
    return await Launcher(options, **kwargs).launch()
  File "/usr/local/lib/python3.6/dist-packages/pyppeteer/launcher.py", line 174, in launch
    self.browserWSEndpoint = self._get_ws_endpoint()
  File "/usr/local/lib/python3.6/dist-packages/pyppeteer/launcher.py", line 219, in _get_ws_endpoint
    self.proc.stdout.read().decode()
pyppeteer.errors.BrowserError: Browser closed unexpectedly:
LaunchProcess: failed to execvp:
/root/.local/share/pyppeteer/local-chromium/588429/chrome-linux/nacl_helper
[30562:30562:0106/224746.491855:ERROR:nacl_fork_delegate_linux.cc(314)] Bad NaCl helper startup ack (0 bytes)
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server "localhost:10.0"
      after 0 requests (0 known processed) with 0 events remaining.
[30560:30560:0106/230519.955546:ERROR:chrome_browser_main_extra_parts_x11.cc(62)] X IO error received (X server probably went away)

我的想法是开个远程的桌面,然后就让图形界面的chrome在远程桌面上一直跑着。


我尝试了许多方法,比如说Xrdp Servervnc server
最后选择了tightvncserver

apt install tightvncserver
vncserver #设置vnc密码
vncserver -kill :1
.........

具体的安装步骤参考:How to Install and Configure VNC on Ubuntu 18.04 | DigitalOcean


参考:
Chrome nacl error in ubuntu 14.04 - Ask Ubuntu
How to Install the Desktop Components (GUI) on an Ubuntu Server | Linux Training Academy
How to Install Xrdp Server (Remote Desktop) on Ubuntu 18.04 | Linuxize

 类似资料: