LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Interesting VNC Display Question (https://www.linuxquestions.org/questions/linux-software-2/interesting-vnc-display-question-396097/)

nymusicman 12-23-2005 09:20 PM

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)?

mazinoz 12-24-2005 12:02 AM

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.

nymusicman 12-24-2005 11:26 AM

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.

mazinoz 12-24-2005 03:36 PM

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

mazinoz 12-24-2005 03:42 PM

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

nymusicman 12-25-2005 06:57 AM

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.

mazinoz 12-25-2005 02:34 PM

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

Brian1 01-03-2006 09:10 PM

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

nymusicman 01-05-2006 02:10 PM

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.


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