Eu tenho alguns anos de experiência com o uso do Linux na linha de comando, mas esta é minha primeira vez tentando configurá-lo com uma GUI.
Estou no CentOS 7 (64 bits) e executei os seguintes comandos:
yum groupinstall "X Window System" "Desktop"
yum install tigervnc-server xorg-x11-fonts-Type1
vncpasswd
Depois de usar esses comandos para instalar coisas (um servidor VNC e o Gnome, eu acho), eu criei este arquivo em /root/.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 &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &
exec gnome-session &
Então eu tentei iniciar o servidor vnc apenas com isto: vncserver
. Isto impresso:
New '<VM-Name>:1 (root)' desktop is <VM-Name>:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/<VM-Name>:1.log
Eu iniciei o VNC Viewer em minha máquina local (Windows 7, 64 bits) e conectei-me à VM, mas tudo o que vi foi um fundo cinza escuro com três caixas de seleção no canto superior esquerdo em relação às pranchetas. Eu recebo um X por um cursor.
Nada que eu pressione o teclado parece fazer alguma coisa.
Tudo parece bom, mas eu estava esperando para ter algum tipo de área de trabalho do qual eu poderia procurar o meu sistema de arquivos ... ou alguma outra maneira de fazer qualquer coisa graficamente com esta VM.
Parece que ele não deve estar localizando minha janela ou gerenciador de área de trabalho ou algo assim (minha terminologia pode estar desativada - corrija-me se estiver) - mas meu script disse para iniciar o gnome, e os logs VNC não indicaram nenhum problema, então eu não deveria ver algo diferente de um retângulo cinza?
Desde que eu mencionei, aqui está o que está em meus registros do VNC ( /root/.vnc/<VM-Name>:1.log
):
Xvnc TigerVNC 1.2.80 - built Jun 10 2014 06:14:52
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11500000, The X.Org Foundation
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension VNC-EXTENSION
Initializing built-in extension GLX
Wed Sep 30 13:10:31 2015
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
Wed Sep 30 13:10:47 2015
Connections: accepted: <my ip>::47407
SConnection: Client needs protocol version 3.8
SConnection: Client requests security type VncAuth(2)
Wed Sep 30 13:11:02 2015
VNCSConnST: Server default pixel format depth 24 (32bpp) little-endian rgb888
VNCSConnST: Client pixel format depth 8 (8bpp) color-map
Wed Sep 30 14:27:49 2015
Connections: closed: <my ip>::47407 (Clean disconnection)
SMsgWriter: framebuffer updates 3
SMsgWriter: raw rects 1, bytes 16396
SMsgWriter: ZRLE rects 1, bytes 802
SMsgWriter: raw bytes equivalent 802840, compression ratio 46.682172
Nada aqui indica qualquer tipo de erro para mim. Existe outro arquivo de log que eu deveria verificar em outro lugar? Devo de alguma forma entrar em um modo de depuração para algo (what / how?) Existe algo faltando no meu script xstartup
(com a forma +x
executável, a propósito). Está tudo funcionando bem e há apenas uma combinação de teclas que preciso enviar para obter uma tela diferente da tela cinza em branco? Há algo que eu deveria procurar em netstat
ou ps
que indicaria para mim se as coisas estavam ou não estavam funcionando?
Edit: Depois de fazer alterações sugeridas pelo roaima para o meu arquivo xstartup e reiniciar o VNC, esta é a saída que estou recebendo no arquivo de log:
Xvnc TigerVNC 1.2.80 - built Jun 10 2014 06:14:52
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11500000, The X.Org Foundation
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension VNC-EXTENSION
Initializing built-in extension GLX
Thu Oct 1 12:01:36 2015
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
/root/.vnc/xstartup: line 8: gnome-session: command not found
/root/.vnc/xstartup: line 6: xterm: command not found
xauth: file /root/.serverauth.2286 does not exist
X.Org X Server 1.15.0
Release Date: 2013-12-27
X Protocol Version 11, Revision 0
Build Operating System: 2.6.32-220.17.1.el6.x86_64
Current Operating System: Linux InteractSL-TaylorCognosTest 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11 UTC 2015 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-229.7.2.el7.x86_64 root=UUID=9bdbb9b7-a256-4676-8449-34b054b2950a ro vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun16 LANG=en_US.UTF-8
Build Date: 10 April 2015 11:44:42AM
Build ID: xorg-x11-server 1.15.0-33.el7_1
Current version of pixman: 0.32.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Oct 1 12:01:39 2015
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension XFree86-VidModeExtension
Initializing built-in extension XFree86-DGA
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension GLX
xinit: connection to X server lost
^M
waiting for X server to shut down
Thu Oct 1 12:01:39 2015
Connections: accepted: 129.42.208.178::30139
Thu Oct 1 12:01:40 2015
SConnection: Client needs protocol version 3.8
SConnection: Client requests security type VncAuth(2)
error setting MTRR (base = 0xf0000000, size = 0x00400000, type = 1) Invalid argument (22)
(EE) Server terminated successfully (0). Closing log file.
Thu Oct 1 12:01:41 2015
VNCSConnST: Server default pixel format depth 24 (32bpp) little-endian rgb888
VNCSConnST: Client pixel format depth 8 (8bpp) color-map
Thu Oct 1 12:05:11 2015
Connections: closed: 129.42.208.178::30139 (Clean disconnection)
SMsgWriter: framebuffer updates 3
SMsgWriter: raw rects 1, bytes 16396
SMsgWriter: ZRLE rects 1, bytes 773
SMsgWriter: raw bytes equivalent 802840, compression ratio 46.761023