Tuesday, September 6, 2011

The first day of being on my own


  • Ubuntu command for finding out which users are logged in: who
[username]@[hostname]:~$ who
[username] tty7 2011-08-09 15:00 (:0)
[username] pts/1 2011-09-06 13:54 (c-98-234-53-135.hsd1.ca.comcast.net)


  • what do the terms "tty" and "pts" mean?

TTY Definition: Teletypewriter originally and now also means any terminal on Linux/Unix systems. It also means any serial port on Unix/Linux systems.

PTS Definition: Stands for pseudo terminal slave.

The difference between TTY and PTS is the type of connection to the computer. TTY ports are direct connections to the computer such as a keyboard/mouse or a serial connection to the device. PTS connections are SSH connections or telnet connections. All of these connections can connect to a shell which will allow you to issue commands to the computer.

http://www.question-defense.com/2009/09/11/what-do-pts-and-tty-mean-on-linux-what-is-the-difference-between-the-two-terminal-types

  • VNC into Ubuntu GNOME remote desktop
  1. make sure GNOME vino-server is running on remote host
Check that vino-server is running. Here it is process 1302.

[username]@[hostname]:~$ ps -ef | grep vino
[username] 1302 1220 0 Aug09 ? 00:22:03 /usr/lib/vino/vino-server --sm-disable
[username] 22988 22953 0 20:22 pts/0 00:00:00 grep --color=auto vino

Make sure the vino-server is listening on port 5900. Here is PID 1302 matches the port 5900 to the vino-server process .

[username]@[hostname]:~$ netstat -nlp | grep vino
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::5900 :::* LISTEN 1302/vino-server
unix 2 [ ACC ] STREAM LISTENING 8065 1302/vino-server /tmp/orbit-[username]/linc-516-0-25de38931f71d

  1. set up ssh local port forwarding to the local host
On local host, issue the command "ssh -L 5900:localhost:5900 [username]@[remote host ip address]

This forwards remote host's desktop the my local machine's port 5900.
  1. run VNC on local machine
Launch Chicken of VNC. Start a connection. Set Host to "localhost" and Display to "0" which is acutally port 5900, leave password empty, and use default for other fields. Then connect.



The remote desktop for the user account of "[username]" on the remote host should appear in the VNC window. Yah, it works!

Tomorrow, onto deploying the RoR application to the laptop's apache webserver!

A note about vino-server

Note the vino-server is the default VNC server in Ubuntu. It is part of the GNOME desktop. It doesn't start automatically from bootup, and is only started when a user has logged into the account and started the GNOME desktop. Currently, Adrian has left the user "[username]" locally logged into the Ubuntu laptop, therefore, the vino-server is running for the user "[username]".

If the laptop was a monitor-less machine where it is not possible for a user to locally log into the machine, this workaround may work:

References: