You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
systemd vnc service does not start properly during VM startup when user home is mounted with NFS root squash.
To Reproduce
install systemd vnc service on Oracle Linux 9
systemctl disable firewalld
create user with NFS home directory, and ensure NFS root squash is enabled.
add user to /etc/tigervnc/vncserver.users with :2 display
sudo to user and run vncpasswd to set password
systemctl enable vncserver@:2.service
systemctl start vncserver@:2.service
verify vnc session from client works properly
reboot system
systemctl status vncserver@:2.service (should be active)
netstat -nltlp | grep 5902 (should be open)
Actual behavior for step 10 is:
[sroth@sroth-ol9 ~]$ systemctl status vncserver@:2.service
○ vncserver@:2.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:2.service; enabled; preset: disabled)
Active: inactive (dead) since Fri 2025-01-10 11:21:46 EST; 4min 8s ago
Duration: 4ms
Process: 2361 ExecStartPre=/usr/libexec/vncsession-restore :2 (code=exited, status=0/SUCCESS)
Process: 2370 ExecStart=/usr/libexec/vncsession-start :2 (code=exited, status=0/SUCCESS)
Main PID: 2377 (code=exited, status=0/SUCCESS)
CPU: 24ms
Expected behavior
vncserver@:2.service should be Active and port 5902 should be open.
Server (please complete the following information):
OS: Oracle Linux 9.5
VNC server: TigerVNC
VNC server version: 1.14.1-1
Server downloaded from: ol9_appstream yum repository
Server was started using: systemctl enable vncserver@:2.service
Additional context
With a local user, the vncserver service starts up properly during VM startup.
It appears that vncservice (as root) is trying to write to the user's home directory at path ~/.local/state/tigervnc. I see the following logged in journalctl:
[root@sroth-ol9 ~]# journalctl -fe|grep vnc
Jan 10 15:12:51 sroth-ol9.... vncsession[2406]: pam_unix(tigervnc:session): session opened for user sroth(uid=....) by sroth(uid=0)
Jan 10 15:12:51 sroth-ol9.... vncsession[3057]: Failure creating "/home/sroth/.local/state/tigervnc": Permission denied
Jan 10 15:12:51 sroth-ol9..... vncsession[2406]: vncsession: vncserver exited with status=71
It also seems to work properly for a user with a NFS root squash home directory if I change the systemd service file to delay startup until the end of the VM startup process, by changing
After=syslog.target network.target systemd-user-sessions.service
to
After=multi-user.target
I'm not sure why/how that changes the behavior, but it provided a workaround in my case.
The text was updated successfully, but these errors were encountered:
Describe the bug
systemd vnc service does not start properly during VM startup when user home is mounted with NFS root squash.
To Reproduce
Actual behavior for step 10 is:
[sroth@sroth-ol9 ~]$ systemctl status vncserver@:2.service
○ vncserver@:2.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:2.service; enabled; preset: disabled)
Active: inactive (dead) since Fri 2025-01-10 11:21:46 EST; 4min 8s ago
Duration: 4ms
Process: 2361 ExecStartPre=/usr/libexec/vncsession-restore :2 (code=exited, status=0/SUCCESS)
Process: 2370 ExecStart=/usr/libexec/vncsession-start :2 (code=exited, status=0/SUCCESS)
Main PID: 2377 (code=exited, status=0/SUCCESS)
CPU: 24ms
Expected behavior
vncserver@:2.service should be Active and port 5902 should be open.
Server (please complete the following information):
Additional context
With a local user, the vncserver service starts up properly during VM startup.
It appears that vncservice (as root) is trying to write to the user's home directory at path ~/.local/state/tigervnc. I see the following logged in journalctl:
[root@sroth-ol9 ~]# journalctl -fe|grep vnc
Jan 10 15:12:51 sroth-ol9.... vncsession[2406]: pam_unix(tigervnc:session): session opened for user sroth(uid=....) by sroth(uid=0)
Jan 10 15:12:51 sroth-ol9.... vncsession[3057]: Failure creating "/home/sroth/.local/state/tigervnc": Permission denied
Jan 10 15:12:51 sroth-ol9..... vncsession[2406]: vncsession: vncserver exited with status=71
It also seems to work properly for a user with a NFS root squash home directory if I change the systemd service file to delay startup until the end of the VM startup process, by changing
After=syslog.target network.target systemd-user-sessions.service
to
After=multi-user.target
I'm not sure why/how that changes the behavior, but it provided a workaround in my case.
The text was updated successfully, but these errors were encountered: