zoukankan      html  css  js  c++  java
  • ubuntu怎么连接centos远程桌面

    1、系统软件设置
    CentOS端:
    查看是否安装了vnc软件
    # rpm -q vnc vnc-server
    package vnc is not installed
    vnc-server-4.1.2-14.e15_3.1
    上面信息就是说,vnc没有安装,而vnc-server已经安装了。
    那么,安装 vc
    # yum install vnc
    如果vnc-server没有安装,那么
    # yum install vnc-server
    Ubuntu端:
    安装vnc4server
    $ sudo apt-get install vnc4server
    设置密码
    $ vncpasswd
    password:
    verify:
    $ vim ~/.vnc/xstartup
    #!/bin/sh
    # Uncomment the following two lines for normal desktop:
    #unset SESSION_MANAGER
    #exec /etc/X11/xinit/xinitrc
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    x-window-manager &
    修改之后是:
    注释最后两行,也就是在前面加 #
    #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    #x-window-manager &
    然后加上
    gnome-session &
    $ vnc4server
    Warning: user-MS-7549:1 is taken because of /tmp/.X11-unix/X1
    Remove this file if there is no X server user-MS-7549:1
    xauth: creating new authority file /home/user/.Xauthority
    New 'user-MS-7549:2 (user)' desktop is user-MS-7549:2
    Creating default startup script /home/user/.vnc/xstartup
    Starting applications specified in /home/user/.vnc/xstartup
    Log file is /home/user/.vnc/user-MS-7549:2.log

    2、远程桌面使用
    用CentOS使用vncviewer (安装的vnc包中)
    $ vncviewer
    Ubuntu的vnc4server启动之后,默认的端口是5900
    然后,上面New 'user-MS-7549:2 (user)' desktop is user-MS-7549:2就是+2的意思,
    所以是5900+2=5902
    OK之后,密码就是上面
    $ vncpasswd 中设置的密码。
    如果倒过来,用Ubuntu远程桌面登录CentOS。那么就要在Ubuntu安装 xvnc4viewer, 在CentOS上设置vncpasswd,其它都倒过来。
  • 相关阅读:
    01-helloworld
    F2. Nearest Beautiful Number (hard version) (思维+分类讨论+枚举)
    CF1559 D2. Mocha and Diana (Hard Version)
    牛客小白月赛36——全部施工完毕
    [P4735] 最大异或和——可持久化trie + 思维
    CF1322B Present(思维 + 位运算 + 双指针 + 枚举)
    牛客每日一题SCI2005扫雷
    一些没见过的dp模型
    思维训练——CF1304E 1-Trees and Queries
    思维训练——CF1292B Aroma's Search
  • 原文地址:https://www.cnblogs.com/Siegel/p/7500967.html
Copyright © 2011-2022 走看看