Ubuntu安装vnc并解决花屏问题

  • 如果是root环境,文件:\root\.vnc\xstartup
  • vim ~\.vnc\xstartup
    # 记住编辑完了之后,要提权,原先花屏的原因不排除是因为这个文件没有提权
    sudo chmod +x ~\.vnc\xstartup

    xstartup文件内容:

  • #!/bin/sh
    # Uncomment the following two lines for normal desktop:
    export XKL_XMODMAP_DISABLE=1
    unset SESSION_MANAGER
    # exec /etc/X11/xinit/xinitrc
    unset DBUS_SESSION_BUS_ADDRESS
    gnome-panel &
    gnmoe-settings-daemon &
    metacity &
    nautilus &
    gnome-terminal &

    安装gnome

  • apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal 

    重启命令: reboot
    • vnc服务启动:vncserver

  • 注意端口号5901还是别的
  • 云服务器 搭建 Ubuntu 可视化界面-实践教程-文档中心-腾讯云
posted @ 2025-02-13 19:35  有翅膀的大象  阅读(274)  评论(0)    收藏  举报