2

I cannot connect with VNC. sudo service --status-all output:

pi@raspberrypi:~ $ sudo service --status-all
 [ - ]  alsa-utils
 [ + ]  apache-htcacheclean
 [ + ]  apache2
 [ + ]  avahi-daemon
 [ + ]  bluetooth
 [ - ]  console-setup.sh
 [ + ]  cron
 [ + ]  dbus
 [ + ]  dhcpcd
 [ + ]  dphys-swapfile
 [ + ]  fake-hwclock
 [ + ]  gdomap
 [ + ]  hddtemp
 [ - ]  hwclock.sh
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  lightdm
 [ + ]  minissdpd
 [ + ]  mysql
 [ + ]  networking
 [ - ]  nfs-common
 [ + ]  nmbd
 [ - ]  paxctld
 [ - ]  pcscd
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ + ]  procps
 [ + ]  proftpd
 [ + ]  raspi-config
 [ - ]  rpcbind
 [ - ]  rsync
 [ + ]  rsyslog
 [ + ]  samba
 [ - ]  samba-ad-dc
 [ + ]  smbd
 [ + ]  ssh
 [ - ]  sudo
 [ + ]  transmission-daemon
 [ + ]  triggerhappy
 [ + ]  udev
 [ - ]  x11-common

When I connect with PuTTY, I get an error when I give the startx command.

pi@raspberrypi:~ $ startx

X.Org X Server 1.19.2
Release Date: 2017-03-02
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:1                                             9:23 GMT 2017 armv7l
Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1280 bcm2708_fb.fbheight                                             =720 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3f000000 vc_mem                                             .mem_size=0x3f600000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 roo                                             t=PARTUUID=020c3677-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwai                                             t rootdelay=5
Build Date: 18 October 2017  04:55:30PM
xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support)
Current version of pixman: 0.34.0
        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: "/home/pi/.local/share/xorg/Xorg.1.log", Time: Tue Jan 23 23:30:4                                             2 2018
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.1.log" f                                             or additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console

/home/pi/.local/share/xorg/Xorg.1.log output:

pi@raspberrypi:~ $ cat /home/pi/.local/share/xorg/Xorg.1.log
[ 88814.438]
X.Org X Server 1.19.2
Release Date: 2017-03-02
[ 88814.438] X Protocol Version 11, Revision 0
[ 88814.438] Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
[ 88814.438] Current Operating System: Linux raspberrypi 4.9.59-v7+ #1047 SMP Su                                             n Oct 29 12:19:23 GMT 2017 armv7l
[ 88814.439] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1280 bcm270                                             8_fb.fbheight=720 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3f                                             000000 vc_mem.mem_size=0x3f600000  dwc_otg.lpm_enable=0 console=ttyS0,115200 con                                             sole=tty1 root=PARTUUID=020c3677-02 rootfstype=ext4 elevator=deadline fsck.repai                                             r=yes rootwait rootdelay=5
[ 88814.439] Build Date: 18 October 2017  04:55:30PM
[ 88814.439] xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support)                                             
[ 88814.439] Current version of pixman: 0.34.0
[ 88814.439]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[ 88814.439] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 88814.440] (==) Log file: "/home/pi/.local/share/xorg/Xorg.1.log", Time: Tue J                                             an 23 23:30:42 2018
[ 88814.441] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 88814.442] (==) No Layout section.  Using the first Screen section.
[ 88814.442] (==) No screen section available. Using defaults.
[ 88814.442] (**) |-->Screen "Default Screen Section" (0)
[ 88814.442] (**) |   |-->Monitor "<default monitor>"
[ 88814.443] (==) No device specified for screen "Default Screen Section".
        Using the first device section listed.
[ 88814.443] (**) |   |-->Device "Allwinner A10/A13 FBDEV"
[ 88814.443] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[ 88814.443] (==) Automatically adding devices
[ 88814.443] (==) Automatically enabling devices
[ 88814.443] (==) Automatically adding GPU devices
[ 88814.443] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 88814.443] (WW) The directory "/usr/share/fonts/X11/misc" does not exist.
[ 88814.443]    Entry deleted from font path.
[ 88814.443] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 88814.444]    Entry deleted from font path.
[ 88814.444] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[ 88814.444]    Entry deleted from font path.
[ 88814.444] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[ 88814.444]    Entry deleted from font path.
[ 88814.444] (==) FontPath set to:
        /usr/share/fonts/X11/100dpi/:unscaled,
        /usr/share/fonts/X11/Type1,
        /usr/share/fonts/X11/100dpi,
        built-ins
[ 88814.444] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 88814.444] (II) The server relies on udev to provide the list of input devices                                             .
        If no devices become available, reconfigure udev or disable AutoAddDevic                                             es.
[ 88814.444] (II) Loader magic: 0x1fbf40
[ 88814.444] (II) Module ABI versions:
[ 88814.444]    X.Org ANSI C Emulation: 0.4
[ 88814.444]    X.Org Video Driver: 23.0
[ 88814.444]    X.Org XInput driver : 24.1
[ 88814.444]    X.Org Server Extension : 10.0
[ 88814.457] (II) systemd-logind: took control of session /org/freedesktop/login                                             1/session/c10
[ 88814.458] (II) no primary bus or device found
[ 88814.458] (II) LoadModule: "glx"
[ 88814.459] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 88814.467] (II) Module glx: vendor="X.Org Foundation"
[ 88814.467]    compiled for 1.19.2, module version = 1.0.0
[ 88814.467]    ABI class: X.Org Server Extension, version 10.0
[ 88814.467] (II) LoadModule: "fbturbo"
[ 88814.467] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so
[ 88814.468] (II) Module fbturbo: vendor="X.Org Foundation"
[ 88814.468]    compiled for 1.19.2, module version = 0.5.1
[ 88814.468]    Module class: X.Org Video Driver
[ 88814.468]    ABI class: X.Org Video Driver, version 23.0
[ 88814.468] (II) FBTURBO: driver for framebuffer: fbturbo
[ 88814.468] (EE)
Fatal server error:
[ 88814.468] (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
[ 88814.469] (EE)
[ 88814.469] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[ 88814.469] (EE) Please also check the log file at "/home/pi/.local/share/xorg/                                             Xorg.1.log" for additional information.
[ 88814.469] (EE)
[ 88814.470] (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
[ 88814.470] (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
[ 88814.472] (EE) Server terminated with error (1). Closing log file.
  • If I read this correct, you try to start another X instance on the local display, while you are already having X running. This isn't going to work that simple, and it sure isn't what you intend to do. What do you intend to do? – Janka Jan 23 '18 at 21:11
  • I want to connect to RPi with VNC, but I guess X and VNC do not work. – Harun Reşit Ç Jan 24 '18 at 0:46
1

Assuming you're running raspbian, you can simply enable vnc from raspi-config, under interfacing options I believe. This will start you a vnc service mode server, which will let you control the console session.

You can't run startx from an ssh login since it's not associated with a vt (virtual terminal). At any rate this isn't the way to get vnc running. What you can do (as an alternative to enabling the service mode server above) is to run the "vncserver" command, which will start you a virtual desktop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.