Connect to a Node with VNC

You can access a node in an Oracle Java Cloud Service instance by using a Virtual Network Computing (VNC) client utility.

You can use VNC to work with any OS resources that are accessible from the node, including graphical applications.

From a Windows platform, you can use RealVNC or TightVNC. From a Linux platform, you can use the vncviewer utility that is included with your Linux distribution.

By default, the VNC server on a node in Java Cloud Service uses a port that is not directly available through the Internet. An SSH tunnel enables access to the node’s VNC server port on your local computer. An SSH tunnel also ensures that all VNC communication uses a secure protocol.

  1. Access your service console.
  2. Click the name of the service instance that contains the node that you want to access.
  3. On the Overview page, identify the Public IP address of the node that you want to access.
    For example, 203.0.113.13.
  4. From your computer, run the ssh command to connect to the node as the opc user.

    Provide the path to the private key that corresponds to the public key that you specified when you created this service instance, and the node’s public IP address.

    The command format is: ssh -i path_to_private_key opc@node_IP_address

    For example: ssh -i /home/myuser/id_rsa opc@203.0.113.13

  5. If prompted, enter the passphrase for the private key.
  6. Switch to the oracle user.
    sudo su - oracle

    The oracle user has regular OS user permissions. It is intended to be used to start and stop Oracle products that have been installed on the node, or to run other Oracle applications and utilities on the node.

  7. Disable the desktop screensaver lock for this user.
    gconftool-2 -s -t bool /apps/gnome-screensaver/lock_enabled false

    This Linux property controls whether or not the desktop prompts you for the user’s password when in screensaver mode.

  8. Start the VNC server on the node, and if necessary change the screen resolution to match the resolution of your local computer. For example, to 1680 x 1050.
    vncserver -nolisten tcp -localhost -geometry 1680x1050
  9. When prompted, enter a password for this VNC session.
  10. Note the display number for this VNC session, such as :1.
    By default, the listen port is 5901 for VNC session :1 , port 5902 for VNC session :2, and so on.
  11. Disconnect from the node.
    exit
  12. Run the following command to open an SSH tunnel to localhost:vnc_port on the node.

    The command format is: ssh -i path_to_private_key -L vnc_port:localhost:vnc_port opc@node_IP_address -N

    For example: ssh -i /home/myuser/id_rsa -L 5901:localhost:5901 opc@203.0.113.13 -N

  13. If prompted, enter the passphrase for the private key.
  14. Start your VNC client application and connect to localhost:vnc_port.
  15. When prompted, enter the password that you previously configured for this VNC session.

After your work with the SSH tunnel is completed, press Ctrl+C on your local computer to close the SSH tunnel.

To terminate the VNC server on the node, run the command vncserver —kill :display_num. For example, vncserver —kill :1