Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
|
 |
|
10-07-2005, 03:14 PM
|
#1
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Rep:
|
keep running x programs remotely
Hello guys,
What I have reached so far and have no idea how to continue from here is the following.
I have a linux server running 24/7 with no screen attached. I have compiled amule (for example) which I would like to be running all the time so users can download stuff from the server. When I start amule it connects to a local display on the network which is a laptop that is only rarely on. So, anyone might know a way of keeping the program running on the linux server after the remote X server has gone down? And then when it comes back on to be able to reattach to that screen.
Any help will be appreciated.
Regards,
-Nikolay Kichukov
|
|
|
10-07-2005, 03:49 PM
|
#2
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Not having a screen doesn't mean it doesn't have a display; if the server is starting X, you can route application windows to it. What you want is for the application to display on the server, and run in the background (or detached using the screen command) when you start it remotely. For example:
someapplication -display localhost:0.0 &
An alternative is finding a command-line version of the application, so you don;t need to worry about the display at all.
|
|
|
10-07-2005, 04:33 PM
|
#3
|
Member
Registered: Aug 2003
Location: Akron, OH
Distribution: Slackware 14.2-stable, Ubuntu 16.04 LTS
Posts: 401
Rep:
|
You might also want to check out the "screen" command. I use this command all the time when I am remotely adminstering boxes that are taking a long time. I can start a "session", issue the commands, then detach from that session, leaving the application running. At a later point I can reattach to the session and continue where I left off.
|
|
|
10-08-2005, 12:22 AM
|
#4
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Original Poster
Rep:
|
Hello Guys, thanks for your suggestions, but I think noone understood what I meant.
So, I have the server which only has the xlibs-dev libraries so that I can compile stuff for X. It is not actually running an X server. So in order for me to display the application on my laptop screen which is part of the local network, I log in to the server via ssh and then do :
export DISPLAY="192.168.8.8:0.0"
./application &
whereas beforehand I have allowed connections from the server IP address to the X server on the 192.168.8.8 laptop box with xhost +myserverIP. The problem is not there. This works just great and I would suggest everyone tries this if you are running on a slow machine ;-) It save a lot of computation on your local host.
Now, my question is, is there a way, that I can trick the "application" that is connecting to the remote x server, so when the remote x server exits, the program will not die as it happens now, but rather stay active and perform it's operations.
If you are having any more questions, let them go. I'd be happy to explain in more details what I am trying to do here...
regards,
-Nikolay Kichukov
|
|
|
10-08-2005, 01:15 AM
|
#5
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Re-read post number 2. If you are not running X on the server, then you need a dummy X server. You can create one with xVNC or Xvfb on the server. Set your DISPLAY variable to the dummy X server. It has to go somewhere, and it can't be to the remote laptop if you want to disconnect it. This presumes that you must run a GUI application.
A better solution for amule in particular is to run a command-line version, like amuled. That way you don't need a display at all.
If you want/must run an X application and disconnect, then here's one way:
1. Login to the remote server.
2. Start Xvfb to create a dummy X server:
Xvfb :1 -screen 0 640x480x16 -fbdir ~/ &
3. Start amule on the dummy X server, as a background task:
DISPLAY=localhost:1 amule &
4. You can now logoff. If you want to check on the amule display, reconnect to the server and issue the command:
xwud -in ~/Xvfb_screen0
You will see an image of the dummy display until you click in the window or hit 'q'.
Last edited by macemoneta; 10-08-2005 at 01:41 AM.
|
|
|
10-13-2005, 04:50 PM
|
#6
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Original Poster
Rep:
|
Hello macemoneta,
Thanks for your detailed answers. I have installed xvfb and it is awsome! ;-)
Now when I try to reconnect to the display where my program has successfully connected to I get dead air. Nothing is happening.
Xvfb :2 -screen 0 640x480x16 -fbdir /home/services/
DISPLAY="127.0.0.1:2.0"
xwud -in Xvfb_screen0 invoked from /home/services/
services@nevir:~$ xwud -in Xvfb_screen0
what am I doing wrong there?
regards,
-Nikolay Kichukov
|
|
|
10-13-2005, 05:06 PM
|
#7
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Can you define "dead air" and "nothing is happening"?
xwud shows you a snapshot, not a live connection to the application. If you want to see updates, you need to quit and run xwud successively. The idea is that you don't normally have a connection, you just want the application to keep running as if it has a display.
Your example doesn't show you actually running an application, just setting the display variable. Take a close look at step 3 in my step-by-step.
If you are saying that the application did not open a window as you expect, then that's an issue with that application. Perhaps it needs a larger size display as a minimum, or a different pixel depth. Try with 1024x768x24.
Last edited by macemoneta; 10-13-2005 at 05:08 PM.
|
|
|
10-14-2005, 02:37 AM
|
#8
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Original Poster
Rep:
|
Hello Macemoneta,
Thanks for your patience, I can assure you that the program is running and is properly connected to the dummy display of the xvfb server. I believe the problem was, I tried to access this snapshot from:
Internal IP (192.168.0. network) -> NAT Router -> ssh to remote sshd daemon on the internet -> ssh to my server's extetrnal IP and from the console there run xwud. I believe that is why I got nothing on screen as if there was nothing happening. There are no logs whatsoever that I can provide you with.
Is it possible that I got no image on screen because of being behind a NAT router?
Best regards,
-Nikolay Kichukov
|
|
|
10-14-2005, 04:58 AM
|
#9
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Original Poster
Rep:
|
Sorry for the previous message. It seems to work when I
export DISPLAY="myLaptopDisplayOnTheLocalLan:0.0" and then invoke xwud -in dispalyName.
Something else. Is there a way that I can swith to the already running application without having to kill it and then starting it on the laptop display?
Regards,
-Nikolay Kichukov
|
|
|
10-14-2005, 12:00 PM
|
#10
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Unfortunately, X applications can't, in general, be moved from one X display to another. Some applications (like amule, which you had previous mentioned) allow you to control them from the command line while they are running.
If you want to be able to manipulate the applications on the dummy X server, I suggest you investigate Xvnc (which I had mentioned earlier) instead of Xvfb. You can reconnect to the Xvnc display using vncviewer, and control the application(s).
|
|
|
10-15-2005, 08:36 AM
|
#11
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Original Poster
Rep:
|
Cheers mate,
I shall also try this out ;-0
Regards,
-Nikolay Kichukov
|
|
|
10-23-2005, 08:42 AM
|
#12
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Original Poster
Rep:
|
Hello macemoneta,
Now that I shall use my server as a workstation over the network I have installed x-desktop-* and gdm and iceWM.
I have configured gdm to allow network connections.
I have created a passwd file to pass to x11vnc with -rfbpasswd parameter.
I start x11vnc server as root on the local display where gdm is awaiting a user to log in.
On my laptop I have installed xtightvncviewer to make the connection.
When I connect to the xvnc server I am presented the gnome login screen. I key in my username and password and then all of the sudden x11vnc server exits. However iceWM loads successfully on display :0. So I have to restart the x11vnc server, and then restart xtightvncviewer to login this time to the already connected iceWM session. Have you got an idea why this disconnect is happening?
Here are the logs and the commands in order:
on server side:
/etc/init.d/gdm start
root@nevir:~# x11vnc -display :0 -auth /var/lib/gdm/:0.Xauth -rfbauth passa
...
23/10/2005 15:33:07 X display :0.0 is 16bpp depth=16 true color
FrameBuffer Info:
width: 1024
height: 768
scaled_width: 1024
scaled_height: 768
indexed_color: 0
bits_per_pixel: 16
depth: 16
...
23/10/2005 15:33:07 setting up 32 cursors...
23/10/2005 15:33:07 done.
23/10/2005 15:33:07 Autoprobing TCP port
23/10/2005 15:33:07 Autoprobing selected port 5900
23/10/2005 15:33:07 created 32 tile_row shm polling images.
23/10/2005 15:33:07 fb read rate: 4 MB/sec
23/10/2005 15:33:07 screen setup finished.
23/10/2005 15:33:07
23/10/2005 15:33:07 The VNC desktop is nevir:0
PORT=5900
on the client side:
hijacker@ccja:~$ xtightvncviewer nevir:0
VNC server supports protocol version 3.3 (viewer 3.3)
Password:
VNC authentication succeeded
Desktop name "nevir:0"
Connected to VNC server, using protocol version 3.3
VNC server default format:
16 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0
Using default colormap which is TrueColor. Pixel format:
16 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0
Using shared memory PutImage
on the server side before I authenticate with gdm:
root@nevir:~# 23/10/2005 15:34:57 Got connection from client 192.168.0.2
23/10/2005 15:34:57 other clients:
23/10/2005 15:34:57 Disabled X server key autorepeat.
23/10/2005 15:34:57 to force back on run: 'xset r on' (3 times)
23/10/2005 15:34:57 created xdamage object: 0x800024
23/10/2005 15:34:57 Protocol version 3.3
23/10/2005 15:35:03 Pixel format for client 192.168.0.2:
23/10/2005 15:35:03 16 bpp, depth 16, little endian
23/10/2005 15:35:03 true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
23/10/2005 15:35:03 no translation needed
23/10/2005 15:35:03 Using tight encoding for client 192.168.0.2
23/10/2005 15:35:03 Using compression level 1 for client 192.168.0.2
23/10/2005 15:35:03 Using image quality level 6 for client 192.168.0.2
23/10/2005 15:35:03 Enabling X-style cursor updates for client 192.168.0.2
23/10/2005 15:35:04 Enabling full-color cursor updates for client 192.168.0.2
23/10/2005 15:35:04 Enabling cursor position updates for client 192.168.0.2
23/10/2005 15:35:04 Enabling LastRect protocol extension for client 192.168.0.2
23/10/2005 15:35:04 client 1 network rate 117.5 KB/sec (9262.4 eff KB/sec)
23/10/2005 15:35:04 client 1 latency: 1.1 ms
23/10/2005 15:35:04 dt1: 0.1095, dt2: 0.0477 dt3: 0.0011 bytes: 18406
23/10/2005 15:35:04 link_rate: LR_BROADBAND - 1 ms, 117 KB/s
on the server side after I have entered my authentication information to gdm:
caught XIO error:
23/10/2005 15:36:27 deleted 32 tile_row polling images.
[1]+ Exit 3 x11vnc -display :0 -auth /var/lib/gdm/:0.Xauth -rfbauth passa
on the client side log:
xtightvncviewer: VNC server closed connection
ShmCleanup called
so now on the server side I have:
22021 ? Ss 0:00 /usr/bin/gdm
22022 ? S 0:00 /usr/bin/gdm
22025 ? S 0:05 /usr/X11R6/bin/X :0 -audit 0 -auth /var/lib/gdm/:0.Xau22050 ? Ss 0:00 /usr/bin/icewm-session
22099 ? Ss 0:00 /usr/bin/ssh-agent /usr/bin/icewm-session
22100 ? SNs 0:00 icewmbg
22101 ? Ss 0:01 icewm
22102 ? Ss 0:00 icewmtray
and if I start again x11vnc server and then connect to it with tightvncviewer everythings works perfectly.
Is this due to the fact that now X is running with auth file: -auth /var/lib/gdm/:0.Xau22050 and xvnc server is looking for :0.Xauth ? If so, what can be done to solve this?
regards,
-Nikolay Kichukov
|
|
|
10-23-2005, 10:15 AM
|
#13
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
There's a howto here; you can check your configuration against it.
|
|
|
10-23-2005, 11:18 AM
|
#14
|
LQ Newbie
Registered: Jan 2005
Location: Varna, Bulgaria
Distribution: GNU/Debian Linux sarge
Posts: 12
Original Poster
Rep:
|
hey,
have checked with the config with no luck.
I am getting the same behaviour after I log in. The session gets disconnected and the x11vnc exits.
anything else I might try?
regards
|
|
|
10-23-2005, 11:29 AM
|
#15
|
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
|
Nothing that immediately comes to mind. Post your configuration files (gdm.conf, services, /etc/xinetd.d files created). If I don't spot the problem, then it will be the information someone else will need to help you.
|
|
|
All times are GMT -5. The time now is 01:24 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
|
|