Showing posts with label vnc. Show all posts
Showing posts with label vnc. Show all posts

Friday, August 10, 2012

Connect Remotely to Your Linux Machine Graphically

SkyHi @ Friday, August 10, 2012

Free NX is a client/server application which allows you to login remotely from another PC into your Linux system. The client is available for both Linux and Windows, so you will be able to login from a Windows machine too.
NX client connected to a Debian KDE3 session, 1024x768

In order to set up Free NX, you only need to install three DEB packages, start a SSH server and you're ready to go. In Debian Lenny and Ubuntu, just follow the steps below:

First of all, install the SSH (secure shell) server:

apt-get install openssh-server

SSH listens by default on port 22. You can test your SSH server by trying to login to localhost:

ssh your_username@localhost

And use your user's password. If the login is successful, you can proceed to the next step. In order to logout, just type Ctrl+D.

Next, download the Free NX DEB packages from the NoMachine website, here. The files which you need to download are called:

nxclient_3.3.0-6_i386.deb
nxnode_3.3.0-17_i386.deb
nxserver_3.3.0-22_i386.deb

Next, you will need to install all three of them, so type as root:

dpkg -i nxclient_3.3.0-6_i386.deb
dpkg -i nxnode_3.3.0-17_i386.deb
dpkg -i nxserver_3.3.0-22_i386.deb

What you need to do next is to start the NX server (if it isn't already started). To do that, type as root:

/etc/init.d/nxserver start

The output should be something like this:

# /etc/init.d/nxserver start
NX> 122 Service started.
NX> 999 Bye.
NX> 723 Cannot start NX statistics:
NX> 709 NX statistics are disabled for this server.
NX> 999 Bye.

Now, in order to test if what we've done is working, try to connect using the NX client to your own machine, so run as normal user:

/usr/NX/bin/nxclient

Notice that the path to nxclient is non-standard, so nxclient will not be included in your path; you have to use the full path to it. See the screenshots below of NX client in action:

Enter your username and password from your Linux machine

Configure NX client - I used localhost host here, but from another machine you'll have to enter the IP of the remote machine

An alternative NX client is qtnx (apt-get install qtnx) but I had some stability issues with it when trying to connect to a machine which doesn't has NX server configured.

QtNX, another NX client

The good thing about Free NX is that clients are provided for both Linux and Windows, so you will be able to login into your Linux machine from Windows without any problems.

REFERENCES
http://tuxarena.blogspot.ca/2009/04/connect-remotely-to-your-linux-machine.html

Friday, March 4, 2011

How to Control a Mac From a Windows PC With TightVNC(RealVNC)

SkyHi @ Friday, March 04, 2011
VNC, short for "Virtual Network Computing," is a graphical way of remotely controlling another computer. When you're connected to another computer with VNC, you see that computer's desktop as if you were right in front of it. You control that computer's mouse with your mouse, keyboard with your keyboard, and see exactly what's on the other computer's display on your monitor.

Because VNC is cross-platform, meaning it can be used on Windows, Mac and Linux computers, you can control a Windows PC from a Mac, Linux PC from a Windows PC and all other variations you can think of.

The controlled computer is called the Server and the controlling computer is called the Client.

Here is how it works.

Instruction 

How to Set Up the Server

1.Click on the blue Apple logo on the top left of your screen and select "System Preferences."

2.Select "Sharing" in the Internet & Network section, the third down from the top.

3.Click on the check box next to "Apple Remote Desktop" to activate it. In Mac OSX Leopard, this will be "Remote Mangement."

4.Click the "Access Privileges" button to the right of the "Services" box. In Mac OS X Leopard, click on the "Computer Settings" button.

5.Check "VNC viewers may control screen with password" and enter a secure password. Strong, secure passwords are a combination of numbers and letters with the occasional symbol thrown in. Remember your password.

6.Type in your Mac password in the "Authentication" dialog box that pops up on your screen. This will allow System Preferences to set the password for VNC users.

7.Write down the IP address of the Server Mac, which is located under the "Services" box of the "Sharing" preferences window.

How to Set Up the Client and Control the Server

8.Download and install TightVNC. See Resources below to download.

9.Uncheck "TightVNC Server" and "Web pages and documentation" on the "Select Components" part of the TightVNC install. Leave "TightVNC Viewer" checked.
Run TightVNC after installation is complete.

10.Enter the Mac Server's IP Address and hit "OK"

Enter the Mac Server's password that you set up in Section 1. A window should pop up with the Mac desktop.

 

REFERENCES: 

http://www.ehow.com/how_2193968_mac-windows-pc-using-tightvnc.html 

Mac Screen sharing with Windows: Server did not offer supported security type

SkyHi @ Friday, March 04, 2011
Mac screen sharing from a windows machine using tightvnc(realVNC).
Mac to Mac, go->vnc://ip

ERROR:
I'm getting the error
"Server did not offer supported security type"

SOLUTION:
in System Preferences, Sharing, Screen Sharing, Computer Settings: you have "VNC viewers may control screen with password:" checked. And a password filled in.

realvnc setting:
[Options]
UseLocalCursor=0
UseDesktopResize=1
FullScreen=1
FullColour=1
LowColourLevel=1
PreferredEncoding=ZRLE
AutoSelect=1
Shared=1
SendPtrEvents=1
SendKeyEvents=1
SendCutText=1
AcceptCutText=1
DisableWinKeys=1
Emulate3=0
PointerEventInterval=0
Monitor=
MenuKey=F8
AutoReconnect=1


REFERENCES

http://apple.stackexchange.com/questions/6362/connect-to-vnc-from-windows
http://www.ehow.com/how_2193968_mac-windows-pc-using-tightvnc.html
http://forums.macrumors.com/archive/index.php/t-380251.html
http://shebangme.blogspot.com/2010/11/mac-remote-control-options-screen.html

Saturday, November 13, 2010

Iptables Open VNC Port To Allow Incoming VNC Connections

SkyHi @ Saturday, November 13, 2010
How do I configure Linux system firewall to allow incoming VNC connections?

VNC server listens on the following TCP ports:
=> VNC server on display 0 will listen on TCP ports 5800, 5900 and 6000
=> VNC server on display 1 will listen on TCP ports 5801, 5901 and 6001
=> VNC server on display N will listen on TCP ports 580N, 590N and 600N
In other words a VNC server listens for a VNC client on TCP ports 5800+N, 5900+N, and 6000+N where N is the display which starts at zero. So,
  • 5800+N - Java-based vncviewer;
  • 5900+N - VNC Client Port;
  • 6000+N - X Server port.

Find Out VNC Port

Type the following command:
# netstat -tulp | grep vnc

Update /etc/sysconfig/iptables

Edit /etc/sysconfig/iptables file:
# vi /etc/sysconfig/iptables
Update it as follows:
# Open VNC for USER1
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5800  -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5900  -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6000  -j ACCEPT
# Open VNC for USER2
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5801  -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901  -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6001  -j ACCEPT
Save and close the file. Restart iptables:
# service iptables restart

A Note About Other Linux Distributions

/etc/sysconfig/iptables works only on RHEL / CentOS / Fedora Linux. For other distros update your iptables shell script as follows:
$IPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 5801  -j ACCEPT
$IPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901  -j ACCEPT
$IPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 6001  -j ACCEPT
 
 
REFERENCES
http://www.cyberciti.biz/faq/linux-iptables-open-vncserver-port-6000-5800-5900/ 

Linux: Setup SSH To Tunnel VNC Traffic Though Internet

SkyHi @ Saturday, November 13, 2010
I have UNIX workstation and Linux server at work and Ubuntu desktop at home. It is recommended that I use ssh tunnel the VNC protocol for secure communication. How do I access my UNIX workstation desktop here at home over the Internet using ssh?

VNC can be accessed over the Internet using ssh protocol. This will improve security as traffic will be encrypted.

Sample Setup

pc22.nixcraft.in
 +----------------+                   +-----------------+
 | Laptop @ Home  |---> Internet ---> | UNIX PC @ Work  |
 +----------------+                   +-----------------+
                                       vncserver port 5901
OR

 +----------------+                   +-----------------+
 | Laptop @ Home  |---> Internet ---> | Router/firewall |
 +----------------+                   | port forwarding |
                                      +-----------------+
                                            | fw.nixcraft.in ssh/tcp22
                                            |
                                          ///\\\
                                          //   \\
                                          /      \
                                       +-----------------+
                                       | UNIX/Linux /OS X|
                                       | at work         |
                                       +-----------------+
                                       pc22.nixcraft.in
                                       vncserver @ port 5901
Your work pc may be directly connected to the Internet. Otherwise most offices have a router and firewall installed. You need to make sure your firewall allows port forwarding for TCP port 22 to your UNIX / OS X / workstation or server called pc22.nixcraft.in. It works as follows:
+------------+
 | SSH Client |-------> Internet ssh connection with encryption
 | with       |                         |
 | vncviewer  |                         |
 +------------+                         |
                                       \|/
                             +------------------------+
                             | SSH server at port 22  |
                             | Vncserver at port 5501 |
                             +------------------------+
You connect from your local ssh client (localhost) to your ssh server (pc22.nixcraft.in) installed at your work UNIX pc with port forwarding at router / firewall level. I'm assuming that port forwarding is correctly configured at your office. Now, open the terminal and type the following command:
ssh  -N -f -L 5000:localhost:5901 vivek@pc22.nixcraft.i
The above command will start an ssh connection to pc22.nixcraft.in and also listen on port 5000 on localhost and forward vnc connection to port 5901 on pc22.nixcraft.in. Usaully local and remote port numbers are same to avoid confusion:
ssh  -N -f -L 5901:localhost:5901 vivek@pc22.nixcraft.i
Now, you can use vncviewer at your home as follows:
vncviewer localhost:5901
You can also use GUI tool and set VNC server location to localhost:5901

Fig.01: Setup ssh to tunnel VNC traffic over the Internet
Fig.01: Setup ssh to tunnel VNC traffic over the Internet

Once connected you will get desktop login windows or last session window as follows:
Fig.02: VNC in action and more secure using SSH
Fig.02: VNC in action and more secure using SSH

REFERENCES