LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 12-23-2005, 09:20 PM   #1
nymusicman
Member
 
Registered: Jun 2004
Location: Aurora, IL
Distribution: Slackware Current
Posts: 162

Rep: Reputation: 30
Interesting VNC Display Question


I feel a little guilty because my question is really not a problem but more of a curious nature. I have two computers (duh otherwise I couldn't use VNC.) One Computer is connected through VNC on display :1. Now with my linux box (as most people's boxes) X Windows in on Display :0. So here is my question.

I would like to know if there is any way to send a command from my VNC machine (Display :1) and have it open on my X windows (Display :0)?
 
Old 12-24-2005, 12:02 AM   #2
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Linux Mint - Tara
Posts: 497

Rep: Reputation: 35
Yes, VNC works both ways incidentally and you can configure it to 'drive' the other machine or just watch the display and not be able to do anything. I'm not sure why you would want to send a command through a tunnel to the other computer when you can damn well drive it completely from your PC! Could you explain in detail what you mean.
 
Old 12-24-2005, 11:26 AM   #3
nymusicman
Member
 
Registered: Jun 2004
Location: Aurora, IL
Distribution: Slackware Current
Posts: 162

Original Poster
Rep: Reputation: 30
Well the best way to explain this is to tell the story. My roomate uses my desktop for the internet and that is fine, but sometimes (through vnc) I catch him using it for purposes I do not wish my computer to be used for. So I would like to play pranks on him without him knowing about it. One way to do that in linux is for me to be connected to vnc through :1 and type a command that appears in X windows that he can see. But I do not wish for him to see the command as I type it.
 
Old 12-24-2005, 03:36 PM   #4
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Linux Mint - Tara
Posts: 497

Rep: Reputation: 35
Smile

In this case I think you can just use ssh. I am unable to check this at the moment as my home network is totally disassembled.

Cheers
 
Old 12-24-2005, 03:42 PM   #5
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Linux Mint - Tara
Posts: 497

Rep: Reputation: 35
Smile

In this case I think you can just use ssh. Close your VNC connection then ssh to his machine and shutdown -r
now. Other things you may want to consider are tripwire and blacklists or ACL's. I hope you will use your powers for good. I am unable to check this at the moment as my home network is totally disassembled.

Cheers
 
Old 12-25-2005, 06:57 AM   #6
nymusicman
Member
 
Registered: Jun 2004
Location: Aurora, IL
Distribution: Slackware Current
Posts: 162

Original Poster
Rep: Reputation: 30
I can shutdown -r now from VNC as well, but I don't want to do that. Really I just want to scare him up a little bit. I have already figured out that I can play random music that he will have no idea how to shut off, I've also figured out how to open and close my cdrom drive. But now I want to add a more software visual effect. Programs opening and closing and he doesn't know why, etc... Can ssh do this or vnc or any other tunneling software out there. Thanks for the help.
 
Old 12-25-2005, 02:34 PM   #7
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Linux Mint - Tara
Posts: 497

Rep: Reputation: 35
I'm beginning to suspect you have evil tendencies! Ssh can do this but how to do the visual effects I'm not sure about other than to run a program like this, In windoze I know of one that rotates the screen upside down, but I forget the name, not telling you anymore along this line of questioning so don't ask, I'm beginning to feel sorry for your friend

Ciao
 
Old 01-03-2006, 09:10 PM   #8
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Interesting question, I myself got curious and decided to tackle it. I figured out a way to do what you are after. This is what I did. I vnc into 5901 for display:1 as usual or actually vnc over ssh connection. This is on KDE but should work for other gui's.

Once there open a terminal session on remote machine.
In it run the command ' export DISPLAY:0.0 '.
Now run any gui app with the & at the end.

Example:
xmms &
Now xmms will open up on display:0.

xmessage " This is a test " &
To display a message.

When done close the terminal session and now things work fine in your normal display:1.

You can also redirect an app back to your display but did not confirm it since the local machine was behind a firewall and did not wish to portforward back through it to try.

Found info here about it. http://www.cpqlinux.com/remoteapps.html






Now for some more fun edit the remote server /etc/X11/xorg.conf file and then you can vnc to display:0 on 5900. So now you can watch what is going on on display:0 from local machine.

Add the Load "vnc" and Option "passwordFile" "/home/username/.vnc/passwd" in each section below.
Section "Module"
...
Load "vnc"
EndSection
...
Section "Screen"
...
Option "passwordFile" "/home/username/.vnc/passwd"
EndSection

Logout and restart X

Now you can ' vncviewer remoteIP:0 ' to show display:0
And also ' vncviewer remoteIP:2 ' to show display:2

Been a fun night. Learned a lot here. Hope this helps you out.
Brian1
 
Old 01-05-2006, 02:10 PM   #9
nymusicman
Member
 
Registered: Jun 2004
Location: Aurora, IL
Distribution: Slackware Current
Posts: 162

Original Poster
Rep: Reputation: 30
Thanks so much for finding that out. I'm going to have a lot of fun with this information. I did already know about viewing the :0 display.
 
  


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
Interesting C Question ar1 Programming 2 05-07-2005 10:24 AM
Interesting (My)SQL question rjlee Programming 9 03-07-2005 08:23 AM
Interesting Java question deveraux83 Programming 6 07-08-2004 01:06 PM
One interesting question palanisaravanan Linux - Networking 2 04-21-2004 09:39 AM
An Interesting question about a fresh install gamehack Debian 5 01-27-2004 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 AM.

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