vnc
- Details
- Last Updated: Thursday, 22 July 2021 14:58
- Published: Friday, 12 October 2018 04:51
- Hits: 1319
VNC: Virtual Network Computing
VNC is a graphical desktop sharing system, used to remotely control another PC. It's same as other software as chrome remote desktop, TeamViewer, , etc which allow you to control remote PC. VNC is very popular among enterprises, and is open source under GNU license. VNC was orinally developed in UK. Many other commercial or open source products based on VNC original source code developed. In 2002, VNC R&D center was closed. It's developers formed RealVNC which developed open source as well as commercial product under the same name. Most of the time when people say VNC, they mean RealVNC.
Intro material on Wiki: https://en.wikipedia.org/wiki/Virtual_Network_Computing
VNC server/client model:
VNC software has 2 parts: a sever software, and a client software. You install server software on the desktop which you want to control. You install client software on the desktop from where you want to control. The client software knows how to connect to server software. The client software displays the desktop screen on remote desktop which is running the server software for VNC.
Installation:
Install RealVNC from here: You will need to install both RealVNC server and RealVNC client. They will need to be installed on different computers. Server on the computer to be controlled, and client on the computer that controls the server computer. Choose appropriate OS and then download it.
Real VNC server: https://www.realvnc.com/en/connect/download/vnc/
RealVNC client: https://www.realvnc.com/en/connect/download/viewer/
Running VNC:
Once installed, you can start VNC server on server desktop by clicking on RealVNC icon or typing "vncserver" on terminal. Once started, VNC server always starts on powerup. OWhen vncserver is running, it shows the ip address for the computer on which it is running. It's something like this kind of message:
$vncserver
......
New desktop is raspberrypi (192.168.1.109)
....
Now on the client machine (where you have the VNC client software installed), you enter this number in address section (here, it's 192.168.1.109). Once enetered, it brings up an icon, on which you click, and you can see the remote desktop screen (where VNC server is running). Now if you work on this screen, it seems as if you are directly working on the remote desktop (the screen refreshes amazingly fast. Keystrokes from client to server, as well as pixels from server to client are transmitted pretty fast, especially if both client and server are connected to high speed internet).
vncserver command on Linux terminal can be used with a lot of options to set the display options. One helpful option is:
vncserver -geometry 2560x1024 -depth 24
NOTE: that when we say display, we mean the physical screen that is on the monitor of remote desktop. However, the pixels of that display are stored in memory, and the monitor is just displaying whatever is stored in that memory. So, we can have another display which has pixels stored in memory only and doesn't go to any monitor. This is called a "virtual display". VNC allows these virtual displays to be created on the server machine, and then be accessed using VNC viewer. Thus we can have 10's of display on a single server desktop, where one of them is real display connected to physical monitor, while all others are all virtual displays.
Headless servers or servers which don't have any monitor connected, don't start the gui program for the display. In such cases, VNC server has nothing to display since it always shows the physical display by default. So, in turn VNC server program doesn't start at startup. in such cases, we start VNC server by logging into the server machine via ssh. Then VNC server creates a virtual display and this virtual display can be seen via a VNC client.
On the top center of VNC session, we have a way to kill VNC or set many options. Look thru them, if you need to set anything else.For ex, if you have 2 monitors, and it's not working, try setting "UseAllMonitors to true" over there.
NOTE: we have .vnc dir in the home dir. Inside this dir, is a config file, which controls how the vnc desktop should look. To get full screen extended on desktop, we add these lines to config file, so that we don't have to type it every time on cmd line:
-geometry 2560x1024
-depth 24
Guest Access: In VNC, allowing guest acces to others is easy. Steps:
- Run "vncconfig &" on cmd line. This cmd has to be run on lindesk terminal and not on lsf terminal
- On pop up box, click commands->options. On new pop up box, choose advanced.
- Change guest access to "Interactive" and click apply.
- On main pop-up box, if we click on options, we should see a "tick mark" on Guest Login. If not, tick that by clicking.
- Now, anyone can connect using login "guest" and no password.
- When user requests access, a new box appears on bottom. click on "accept" to allow guest access to your vnc m/c.
Putty:
If we are on a windows machine, and don't have terminal to connect to, we can use a program called Putty, that supports a lot of protocols as ssh, ftp, etc. It has a GUI interface, and is a lot easier to use.
First download Putty. Then Use Putty to SSH to the above machine. That brings up a terminal on remote machine to which you work in usual way. When done, log out of Putty and close the window.
-----------------------------------------------------
ALL JUNK BELOW. NEED TO MOVE ELSEWHERE FIXME ???
LSF:
Any jobs can now be run only in lsf machine. So open xterm on lsf
Open Xterm on an LSF machine: bsub \-Is \-R "linux&&bit64" "xterm" & => OBSELETE
Open Konsole on an LSF machine: bsub \-Is \-R "linux&&bit64" "konsole" & => OBSELETE
Open Konsole on an LSF machine on RHEL6 OS: bsub \-Is \-R "select[ws60]" "konsole" & => use ws40 for RHEL4 (ws60 is latest). ws60 provides latest AME tools.
Open Konsole on an LSF machine on SUSE11 OS: bsub \-Is \-R "select[sles11]" "konsole" & => this was needed to get latest AME tools, but not anymore. SUSE not used anymore
Run <tool_name> -ame on both OS to see which gives you latest tools. Some newer versions may be avilable on 1 OS and not on other.
OS for Artisan:
Artisan 5.2.1 and earlier will only run on the legacy SuSE11 OS.
Artisan 5.3 will run on both SuSE11 and RHEL6.
The upcoming Artisan 5.4 will only run on RHEL6.
Run icfb on suse m/c: bsub -R "select[sles11]" -Is icfb -artisan-2.91p1 &
NOTE: to get around check and save issues, run icfb on suse m/c: icfb -artisan-5.2.1
For LSF jobs submitted, if we want to know what OS job got submitted on, look in the log file (i.e irun.log) to find name of lsf m/c. Then run:
ex: /home/kagrawal/ > lshosts machine1.com => last 2 RHS entries show OS
HOST_NAME type model cpuf ncpus maxmem maxswp server RESOURCES
dlewz2732.d LIN_X64 p4x_3400 417.0 12 262047M 262145M Yes
(bit64 cs dc X64 linux srvClass01 maxmem32G linux26 maxmem64G p4x maxmem128G warm maxmem256G sles suse sles11p2 !sles11) => OS is sles11.2
#Preventing jobs from getting killed in lsf:
jobexclude --add <jobid> => to add a job
jobexclude --list => to list all added jobs
#snapshot
In any dir, there is .snapshot dir, within which is there are dir with timestamp. Just cd into appr dir, and cp stuff that is to be retrieved.
dssc cmds:
---------
dssc -help => lsits all options
dssc <cmd_name> -help => lists syntax of a specific cmd
checkin:
checkin for 1st tme: dssc ci -new <file/dir> -com "comments_here" -rec => -rec needed for recursive
checkin a file after editing with lock: dssc ci <filename>
dssc ls -report status -rec => shows revs of all checked out files/dir (current rev vs .)
dssc diff "file1.v" "file1.v;Latest" => diffs b/w current modified checked out file against one in repository.
dssc retire -force => to completely remove it from database.
dssc ci -new <file/dir> -skip => use ci with -skip after retiring a file in db. Else, old retired file will be checked in.
checkout:
checkout all files recursively in read mode: dssc pop -rec => does it starting from current dir
checkout a file in readmode: dssc co <filename>
checkout a file in editmode with lock: dssc co -lock <filename>
checkin a file after editing with lock: dssc ci <filename>
dssc cancel:
dssc cancel -force <filename> => this is to cancel checked out file (even with edits), and to repop with original version.
checkout a file in editmode without lock: dssc co -get <filename> => This gives unlocked copy which can be modified. Do a chmod to 664 or 755.
Then to populate the original file (and discard the current modified file), do:
dssc pop -force <filename>
dssc unlock <filename> => To unlock files (i.e remove lock). This can be useful when files can't be checked out or something else gone bad.