LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-10-2010, 04:36 PM   #1
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Rep: Reputation: 3
Unhappy vncserver - load on startup + gray screen?


Hello everyone

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 &
thanks.

Last edited by toxine; 05-11-2010 at 04:07 PM.
 
Old 05-10-2010, 05:13 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You have to remove "exit 0" before the command execution, because it causes the script to exit before running your command

Regarding the vncserver, you should use
Code:
exec gnome-session &
according to this post.

Regards
 
1 members found this post helpful.
Old 05-10-2010, 05:36 PM   #3
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Original Poster
Rep: Reputation: 3
thank you vncserver auto boot now works.

now im having the keyboard issue. different keystrokes result different output.
 
Old 05-10-2010, 05:50 PM   #4
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Original Poster
Rep: Reputation: 3
I think i screwed up ~/.vnc/xstartup

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 &
user
Quote:
#!/bin/sh
xrdb $HOME/.Xresources&
exec gnome-session

Last edited by toxine; 05-10-2010 at 05:56 PM.
 
Old 05-11-2010, 12:38 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

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

Regards
 
1 members found this post helpful.
Old 05-11-2010, 03:04 PM   #6
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Original Poster
Rep: Reputation: 3
okie, i just formatted, no more keyboard problem lol

however, now when i nano ~/.vnc/xstartup
Quote:
#!/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 &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
I cant find "twm &" to replace it with "exec gnome-session &"
Do i need more packages maybe?
:"(
 
Old 05-11-2010, 03:39 PM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

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

Regards
 
1 members found this post helpful.
Old 05-11-2010, 04:07 PM   #8
toxine
Member
 
Registered: May 2010
Distribution: Ubuntu/CentOs
Posts: 33

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by bathory View Post
Hi,

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

Regards
thank you so much!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
samba script won't load during startup and i never get to a login screen nass Slackware 9 04-06-2009 09:47 AM
Gray screen in vncviewer barunparichha Linux - Desktop 1 01-05-2009 05:23 AM
YaST Gray Screen scdark Linux - Newbie 2 05-16-2005 06:42 AM
Robust vncserver startup file (rc.vncserver) arobinson74 Slackware 4 05-14-2005 05:33 AM
gray screen when i startx nObRaIn Slackware 8 12-21-2003 04:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 07:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration