Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
11-30-2016, 02:58 PM
|
#16
|
LQ Newbie
Registered: Nov 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by szboardstretcher
Just the second line then. Leave out the #!/bin/bash -x
Still type it though.
Code:
/usr/bin/vncserver -- ':1' &
|
Unfortunately it gives a very strange response:
PHP Code:
pi@raspberrypi:/var/www/shellscr $ ./vnc2.sh pi@raspberrypi:/var/www/shellscr $ Couldn't start Xtightvnc; trying default font path. Please set correct fontPath in the vncserver script. Couldn't start Xtightvnc process.
Unrecognized option: -- use: X [:<display>] [option] -a # mouse acceleration (pixels) -ac disable access control restrictions -audit int set audit trail level -auth file select authorization file bc enable bug compatibility .......
|
|
|
11-30-2016, 03:01 PM
|
#17
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Progress i suppose.
remove the -- ?
Code:
/usr/bin/vncserver ':1' &
|
|
1 members found this post helpful.
|
11-30-2016, 03:11 PM
|
#18
|
LQ Newbie
Registered: Nov 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by szboardstretcher
Progress i suppose.
remove the -- ?
Code:
/usr/bin/vncserver ':1' &
|
Wow! Thank you! That worked! :-)
Can you explain to me your code?
|
|
|
11-30-2016, 03:13 PM
|
#19
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Anytime.
It was Shadow_7 that suggested it. I just followed the errors until it worked.
But essentially, it calls out the program, says to use display ':1', and puts it into the background with &.
|
|
1 members found this post helpful.
|
11-30-2016, 03:20 PM
|
#20
|
LQ Newbie
Registered: Nov 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by szboardstretcher
Anytime.
It was Shadow_7 that suggested it. I just followed the errors until it worked.
But essentially, it calls out the program, says to use display ':1', and puts it into the background with &.
|
Thank you very much! Made my day! :-)
|
|
|
11-30-2016, 03:40 PM
|
#21
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
The problem is that vncserver requires local access to a virtual console. logging in over ssh doesn't give you that.
To get around that you might try the solution in:
http://www.cl.cam.ac.uk/research/dtg...nc/sshvnc.html
Doesn't mean it will work for you, but you have to forward the vnc protocol to something to interpret it... a vnc server. (I think I got that right, the page includes a "vncvewer" in some of its operation)
Last edited by jpollard; 11-30-2016 at 03:43 PM.
|
|
|
11-30-2016, 04:18 PM
|
#22
|
LQ Newbie
Registered: Nov 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by jpollard
The problem is that vncserver requires local access to a virtual console. logging in over ssh doesn't give you that.
To get around that you might try the solution in:
http://www.cl.cam.ac.uk/research/dtg...nc/sshvnc.html
Doesn't mean it will work for you, but you have to forward the vnc protocol to something to interpret it... a vnc server. (I think I got that right, the page includes a "vncvewer" in some of its operation)
|
The solution from szboardstretcher works over ssh though. Even www-data can execute that shell script successfully now. So my problem is solved.
|
|
|
12-01-2016, 01:40 PM
|
#23
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
The -- tells the shell to stop interpreting past that --. Which would put the '' in question. The '' is basically dropped by the shell before it gets to vncserver when it is interpreted.
vncserver -- :1 &
should also work (in theory).
|
|
|
12-01-2016, 02:51 PM
|
#24
|
LQ Newbie
Registered: Nov 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by Shadow_7
The -- tells the shell to stop interpreting past that --. Which would put the '' in question. The '' is basically dropped by the shell before it gets to vncserver when it is interpreted.
vncserver -- :1 &
should also work (in theory).
|
When everything past that -- isn't interpreted, where's the point to write something past it then? Don't understand unfortunately.
Both versions don't work fot me by the way. It says "Unrecognized option: --".
|
|
|
12-02-2016, 09:22 PM
|
#25
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
When things fail it's normally logged somewhere with some details that might hint as to WHY it's failing. YMMV
$ dmesg
$ journalctl -a
# less /var/log/syslog
# egrep -r -i vncserver /var/log/*
$ egrep -r -i vncserver ~/\.*
|
|
|
12-02-2016, 09:43 PM
|
#26
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
Quote:
Originally Posted by markplus
When everything past that -- isn't interpreted, where's the point to write something past it then? Don't understand unfortunately.
Both versions don't work fot me by the way. It says "Unrecognized option: --".
|
It's a shell thing. The shell tends to interpret the parameters BEFORE it passes the parameters. Doubly odd since the -- should have been stripped off by the shell, aka interpreted and not passed. Which implies that $(vncserver -- :1) isn't being run in a "shell script". Did you leave out the shebang? #!/bin/bash. Not that it matters, if it doesn't work leaving it out would be the saner thing to do.
I should probably test things, but I don't use vncserver. At least not in the past ten years. X2go, ssh with X forwarding and other routes to do roughly the same thing these days. Not that I've used any of those either. But I do like dividing my screen real-estate up with Xephyr to stack it vertically with Xdmx, so I can fit hundreds of lines of code on screen without needing multiple screens. Or fit the entire output of top on screen in our bloated systemd world.
|
|
|
12-03-2016, 05:31 AM
|
#27
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
The shell always interprets the entire line.
the "--" is evaluated as well as anything following it, then all of the results are passed to the application.
How the "--" is handled by the application is up to the application itself. It is USUALLY used to indicate parameters that are to be passed to yet another application, an not used by the base application. This is why the "startx" application uses it. The parameters following the "--" are passed to the X server.
|
|
|
12-03-2016, 07:52 AM
|
#28
|
LQ Newbie
Registered: Nov 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by Shadow_7
It's a shell thing. The shell tends to interpret the parameters BEFORE it passes the parameters. Doubly odd since the -- should have been stripped off by the shell, aka interpreted and not passed. Which implies that $(vncserver -- :1) isn't being run in a "shell script". Did you leave out the shebang? #!/bin/bash. Not that it matters, if it doesn't work leaving it out would be the saner thing to do.
|
The -- doesn't seem to get interpreted by the shell. There's no difference if I put "#!/bin/bash" on the first line of the shell script or not. The -- is always being passed with the rest of the command. It always results in "Unrecognized option: --".
|
|
|
12-03-2016, 08:01 AM
|
#29
|
LQ Newbie
Registered: Nov 2016
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by Shadow_7
When things fail it's normally logged somewhere with some details that might hint as to WHY it's failing. YMMV
$ dmesg
$ journalctl -a
# less /var/log/syslog
# egrep -r -i vncserver /var/log/*
$ egrep -r -i vncserver ~/\.*
|
Tried all of those. Unfortunately didn't find any useful information.
|
|
|
All times are GMT -5. The time now is 01:26 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|