[SOLVED] vncserver - load on startup + gray screen?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying auto load vncserver at startup; i edited "/etc/rc.local" however it didnt work .
here's when i nano /etc/rc.local
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
su - user -c "cd /home/user && vncserver :1 -geometry 1680x1080 -depth 24"
my second question is that when i run vncserver from terminal after logging in, i get a gray screen on vnc viewer.
however, if run vncserver as root, it works fine but the keyboard doesn't function correctly (i get wrong keystrokes)
my nano ~/.vnc/xstartup
Code:
#!/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" &
gnome-session &
I have two ~/.vnc/xstartup, the root one and user one.
root:
Quote:
#!/bin/sh (-)
# Add the following line to ensure you always have an xterm available.
( while true ; do xterm ; done ) &
# 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" &
gnome-session &
Dunno about gnome, but maybe this can help you with the keyboard problem.
BTW, why don't you use the same xstatup for both user and root? Note also that is always better to run servers as a non privileged user for security reasons
twm is a window manager. Perhaps you didn't install it, but you don't really need it.
You can replace "x-window-manager &" with "exec gnome-session &" in xstartup
twm is a window manager. Perhaps you didn't install it, but you don't really need it.
You can replace "x-window-manager &" with "exec gnome-session &" in xstartup
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.