How to setup tigervnc server

I’m having a hard time trying to get tigervnc server to work.
I carefully followed the instructions below from archwiki (even found and pointed out a mistake in someone else’s post) but I still can’t get it to work.

  1. Create a password using vncpasswd which will store the hashed password in ~/.vnc/passwd.
  2. Edit /etc/tigervnc/vncserver.users to define user mappings. Each user defined in this file will have a corresponding port on which its session will run. The number in the file corresponds to a TCP port. By default, :1 is TCP port 5901 (5900+1). If another parallel server is needed, a second instance can then run on the next highest, free port, i.e 5902 (5900+2).
  3. Create ~/.vnc/config and at a minimum, define the type of session desired with a line like session=foo where foo corresponds to which ever DE is to run. One can see which DEs are available on the system by seeing their corresponding .desktop files within /usr/share/xsessions/.

For example:

~/.vnc/config

session=lxqt
geometry=1920x1080
localhost
alwaysshared

Starting and stopping tigervnc

Start vncserver@.service and optionally enable it to run at boot time/shutdown. Note that the display number needs to be specified following the literal @ sign. For :1 it would look like this:

systemctl start vncserver@:1

But when I run systemctl start vncserver@:1 I get:

Job for vncserver@:1.service failed because the control process exited with error code.
See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.

And when I run systemctl status vncserver@:1.service I get:

● vncserver@:1.service - Remote desktop service (VNC)
     Loaded: loaded (/etc/systemd/system/vncserver@:1.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Fri 2021-06-11 16:42:34 IST; 10s ago
    Process: 21330 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=217/USER)

Jun 11 16:42:34 jo-hpenvy systemd[1]: Starting Remote desktop service (VNC)...
Jun 11 16:42:34 jo-hpenvy systemd[1]: vncserver@:1.service: Control process exited, code=exited, status=217/USER
Jun 11 16:42:34 jo-hpenvy systemd[1]: vncserver@:1.service: Failed with result 'exit-code'.
Jun 11 16:42:34 jo-hpenvy systemd[1]: Failed to start Remote desktop service (VNC).

I also tried following instruction from https://linoxide.com/install-configure-tigervnc-arch-linux/ but I still could not get it to work, and I think some for the codes were in complete cause I get message on how to use the command (eg. vncserver gave me message to use it like vncserver <display,>).

Here is the output from inxi --full --verbosity=7 --filter --no-host if needed:

System:
  Kernel: 5.10.41-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 
  Desktop: GNOME 3.38.4 tk: GTK 3.24.29 wm: gnome-shell dm: GDM 40.0 
  Distro: Manjaro Linux base: Arch Linux 
Machine:
  Type: Laptop System: HP product: HP ENVY m7 Notebook 
  v: Type1ProductConfigId serial: <filter> Chassis: type: 10 
  serial: <filter> 
  Mobo: HP model: 81D4 v: KBC Version 87.21 serial: <filter> UEFI: Insyde 
  v: F.56 date: 06/12/2018 
Battery:
  ID-1: BAT0 charge: 17.9 Wh (71.0%) condition: 25.2/25.2 Wh (100.0%) 
  volts: 11.9 min: 11.6 model: Hewlett-Packard Primary type: Li-ion 
  serial: <filter> status: Charging 
Memory:
  RAM: total: 15.52 GiB used: 2.58 GiB (16.6%) 
  RAM Report: 
  permissions: Unable to run dmidecode. Root privileges required. 
CPU:
  Info: Dual Core model: Intel Core i7-7500U bits: 64 type: MT MCP 
  arch: Amber/Kaby Lake note: check rev: 9 cache: L2: 4 MiB bogomips: 23209 
  Speed: 700 MHz min/max: 400/3500 MHz Core speeds (MHz): 1: 700 2: 700 
  3: 701 4: 701 
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon 
  art avx avx2 bmi1 bmi2 bts clflush clflushopt cmov constant_tsc cpuid 
  cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est 
  f16c flexpriority flush_l1d fma fpu fsgsbase fxsr ht hwp hwp_act_window 
  hwp_epp hwp_notify ibpb ibrs ida intel_pt invpcid invpcid_single lahf_lm 
  lm mca mce md_clear mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx pae 
  pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti 
  pts rdrand rdseed rdtscp rep_good sdbg sep smap smep ss ssbd sse sse2 
  sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust 
  tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt 
  xsaves xtopology xtpr 
Graphics:
  Device-1: Intel HD Graphics 620 vendor: Hewlett-Packard driver: i915 
  v: kernel bus-ID: 00:02.0 chip-ID: 8086:5916 class-ID: 0300 
  Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Hewlett-Packard 
  driver: nvidia v: 465.31 bus-ID: 04:00.0 chip-ID: 10de:134d class-ID: 0302 
  Device-3: Chicony HP IR Camera type: USB driver: uvcvideo bus-ID: 1-5:2 
  chip-ID: 04f2:b591 class-ID: 0e02 serial: <filter> 
  Device-4: Chicony HP TrueVision HD type: USB driver: uvcvideo 
  bus-ID: 1-6:3 chip-ID: 04f2:b592 class-ID: 0e02 serial: <filter> 
  Display: x11 server: X.org 1.20.11 compositor: gnome-shell driver: 
  loaded: modesetting unloaded: intel,nouveau failed: nvidia 
  alternate: fbdev,nv,vesa resolution: <missing: xdpyinfo> 
  OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.1.2 
  direct render: Yes 
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:9d71 
  class-ID: 0403 
  Sound Server-1: ALSA v: k5.10.41-1-MANJARO running: yes 
  Sound Server-2: JACK v: 0.125.0 running: no 
  Sound Server-3: PulseAudio v: 14.2 running: yes 
  Sound Server-4: PipeWire v: 0.3.28 running: no 
Network:
  Device-1: Intel Wireless 7265 driver: iwlwifi v: kernel port: 5040 
  bus-ID: 01:00.0 chip-ID: 8086:095a class-ID: 0280 
  IF: wlp1s0 state: up mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global 
  broadcast: <filter> 
  IP v6: <filter> type: noprefixroute scope: link 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Hewlett-Packard driver: r8169 v: kernel port: 4000 bus-ID: 02:00.0 
  chip-ID: 10ec:8168 class-ID: 0200 
  IF: enp2s0 state: down mac: <filter> 
  WAN IP: <filter> 
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb 
  v: 0.8 bus-ID: 1-8:4 chip-ID: 8087:0a2a class-ID: e001 
  Report: rfkill ID: hci0 rfk-id: 7 state: up address: see --recommends 
Logical:
  Message: No logical block device data found. 
RAID:
  Message: No RAID data found. 
Drives:
  Local Storage: total: 931.51 GiB used: 20.76 GiB (2.2%) 
  ID-1: /dev/sda vendor: Western Digital model: WD10JPVX-22JC3T0 
  size: 931.51 GiB speed: 6.0 Gb/s rotation: 5400 rpm serial: <filter> 
  rev: 1A01 scheme: GPT 
  Optical-1: /dev/sr0 vendor: hp model: DVDRW DA8AESH rev: XH61 
  dev-links: cdrom 
  Features: speed: 24 multisession: yes audio: yes dvd: yes 
  rw: cd-r,cd-rw,dvd-r,dvd-ram state: running 
Partition:
  ID-1: / size: 58 GiB used: 20.68 GiB (35.7%) fs: ext4 dev: /dev/sda6 
  label: N/A uuid: a4e2f38e-334f-4d53-ac0a-91f6acb1ef43 
  ID-2: /boot/efi size: 96 MiB used: 74.2 MiB (77.3%) fs: vfat 
  dev: /dev/sda1 label: N/A uuid: DA46-5664 
Swap:
  Alert: No swap data was found. 
Unmounted:
  ID-1: /dev/sda2 size: 16 MiB fs: <superuser required> label: N/A uuid: N/A 
  ID-2: /dev/sda3 size: 124.4 GiB fs: ntfs label: Local Disk 
  uuid: 582C5A902C5A68D0 
  ID-3: /dev/sda4 size: 499 MiB fs: ntfs label: N/A uuid: B4B873F8B873B786 
  ID-4: /dev/sda5 size: 624.37 GiB fs: ntfs label: DATA 
  uuid: 0C323A19323A086A 
USB:
  Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 12 rev: 2.0 
  speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900 
  Device-1: 1-1:6 info: Lenovo Optical Mouse type: Mouse 
  driver: hid-generic,usbhid interfaces: 1 rev: 2.0 speed: 1.5 Mb/s 
  power: 100mA chip-ID: 17ef:608d class-ID: 0301 
  Device-2: 1-5:2 info: Chicony HP IR Camera type: Video driver: uvcvideo 
  interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA chip-ID: 04f2:b591 
  class-ID: 0e02 serial: <filter> 
  Device-3: 1-6:3 info: Chicony HP TrueVision HD type: Video 
  driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA 
  chip-ID: 04f2:b592 class-ID: 0e02 serial: <filter> 
  Device-4: 1-8:4 info: Intel Bluetooth wireless interface type: Bluetooth 
  driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA 
  chip-ID: 8087:0a2a class-ID: e001 
  Hub-2: 2-0:1 info: Full speed (or root) Hub ports: 6 rev: 3.0 
  speed: 5 Gb/s chip-ID: 1d6b:0003 class-ID: 0900 
Sensors:
  System Temperatures: cpu: 75.0 C mobo: 40.0 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 208 Uptime: 9h 33m wakeups: 15 Init: systemd v: 247 Compilers: 
  gcc: 11.1.0 Packages: pacman: 1360 Shell: sh default: Zsh v: 5.8 
  running-in: gnome-terminal inxi: 3.3.04
1 Like

It seems that vncserver commands are missing for me.
commands like
vncserver -kill
and
vncserver -list
are not working for me.

Here is the man vncserver output

It seems that vncserver is now vncsession
but whether I use vncserver or vnsession it does not work for me.

Probably not the answer you’re looking for, but I gave up on TigerVNC a long time ago after spending countless hours fiddling with it and installed RealVNC instead. The drawback is that you have to register an account at RealVNC but I thought it was worth it because it “just works”.

I used RealVNC too but I was really hoping I could get tigervnc working.
I’m using tigervnc on my windows os and it works great but didn’t think it would be so hard to get it working on manjaro. :slightly_frowning_face:

I know the feeling. Used Anydesk on Windows and though the AUR version kinda works it’s not as reliable.

I wonder if the manjaro team would consider preinstalling and configuring tigervnc as it doesn’t even takes much space? :sweat_smile:

That’s actually a very good idea, even more so on the arm version as many Raspberries run in server like setups without a monitor.

1 Like

This is likely too late, but I found tigervnc to actually be the only one that works well on Manjaro. Maybe it is your settings file, which would be here: ~/.vnc/xstartup. If you are running GNOME, I can attest that this file works well:

#!/bin/sh 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey -cursor_name left_ptr
xsetroot -solid grey left_ptr
vncconfig -iconic &
## Adding this 07.01.2021 because can't actually login
#exec gnome-session &
dbus-launch --exit-with-session /usr/bin/gnome-session &

I don’t enable the service at startup, mostly just b/c I have not figured out a clean, secure way to launch the server using systemctl and have it both work right and lock the screen. So instead, I just ssh in when I want to use it and issue: vncserver :1 -localhost no -geometry 2560x1440 -depth 24.