This is the LHCb-Edinburgh collaboration instructions on using UNIX under windows

Basics

There are four basic ways to use Linux/UNIX commands on your windows system.
  • Dual Boot into Linux and windows
  • Install a compiled set of binaries for using UNIX commands directly under windows
  • Use a secure shell connection, to a UNIX machine once running an X server
  • Use a Remote-Desktop connection, to a UNIX machine once running a vncserver +ssh port forwarding

Dual Booting

Can be problematic, especially for laptops, but if it works it is the best option, giving you the best of both worlds.

Unix compiled for windows

Cygwin is a compiled set of UNIX binaries and scripts which runs well on the Win32 kernel (no evidence of compatibility with 64 bit core as of yet). It will be slower than using UNIX directly i.e. through dual booting, but allows you to use UNIX and windows at the same time.

Cygwin is FREE!

The Cygwin installer is tricky to use, you need around 1.5GB free to install and 1GB for temporary files downloaded during installation. Cygwin, (which is a different compilation to Cygwin-X), also comes with an X-server.

To install correctly, with an X-server and all features:

  • Dowload the installer for Cygwin
  • Run the installer to "download without installing", this will help you later. The files created can be deleted later.
  • Select a directory with a lot of space for these files ~1GB is enough
  • DON'T install everything, it doesn't work
  • DON'T use the default installation, only very basic things are added
  • Select from the list of components those that you'd like to get,
    • do this by changing the "skip" or "default" to "full"
    • make sure you select "shells", "graphics" and "X11".
    • Remember what you selected! It will be needed later.
  • Switch the view to the "Not Required, Skip, Not installed" view using the button at the top right
    • Select any component with X11 in the name that you missed.
  • DON'T go back to the package view, as this will reset everything to default
  • Next then should download the required files
  • Run the installer again, with "install from local directory"
  • Select only the components you downloaded earlier
  • Select all the components you downloaded earlier
  • Switch the view to the "Not Required, Skip, Not installed" view using the button at the top right
    • Select everything, as this is a list of the downloaded files you have missed
  • DON'T go back to the package view, as this will reset everything to default
  • Really you should install to your C-drive as long as you have enough space.
  • Just click OK, continue, whatever on any and all errors that appear during installation
  • Run the Cygwin program once it has installed. This will initially establish local home directories

To find your X-server:

  • Either: Use the command startx in the Cygwin window (this will open a new x terminal and x-server)
  • OR: find the batch file startxwin.bat in C:\Cygwin\usr\X11R6\bin and make a shortcut to it
    • this will open just one (bash) window

SSH with an x-server

SSH stands for secure shell. A secure shell connection allows you to log into a Unix system (as if you were sitting at the desk) and use the resources as per usual.

X11R6 is the current UNIX standard graphics interface, it is the protocol used to give you graphics such as windows, buttons, etc. X11 port forwarding is the name for the forwarding method/process by which graphics can be packaged and displayed over a connection, i.e. for ssh. To do this you need a compatible server at each end, Linux, MacOS, or windows running an X-server.

The best X server is eXceed, but this is expensive. Alternatively use Cygwin as above.

Once you have such a server, you should use X11 port forwarding, either by ssh -X in Cygwin/UNIX or by changing your options in the ssh client you have chosen.

puTTy, Cygwin, SSH, provide ssh clients.

VNC - remote desktop system

VNC stands for Virtual Network Computing and is a simple way of exporting your desktop for remote access anywhere with an internet connection.

If you're sick and tired of none-graphical interfaces and you want all the functionality of sitting in front of the machine itself, or even if you have a home PC you'd like to log into remotely from a unix machine Virtual Network Computing VNC is the way to go.

VNC is FREE!!

You need:

  • A VNC client (not mandatory) installed on your local system
  • Java installed on your local system, and plugged into your browser of choice
  • An SSH client (mandatory)

Then:

  • Run a vncserver on the HOST machine
    • UNIX -> open a terminal and type > "vncserver :XX" where XX is the display number you'd like to use (pick something between 0 and 99)
    • Windows -> Start the VNC server that you downloaded, should automatically start display 0 or 1 (port 5900 or 5901).

  • Set up an SSH tunnel on the client machine
    • UNIX -> open a terminal and type > "ssh -X -L 59##:127.0.0.1:59XX username@hostname.com" where XX is the display number of the host server you set up (i.e. 5900+the number, 5901 for display :1) and ## is the port number you'd like to forward to (pick something between 0 and 99)
    • Windows -> Cygwin, open a terminal and type > "ssh -X -L 59##:127.0.0.1:59XX username@hostname.com" where XX is the display number of the host server you set up (i.e. 5900+the number, 5901 for display :1) and ## is the port number you'd like to forward to (pick something between 0 and 99)
    • Windows -> PuTTy, start a putty session.
      • Use the hostname of the computer at which you established the host,
      • In the SSH->Tunnels configure a new tunnel, Source Port: 59##, Destination port: 127.0.0.1:59XX, where XX is the display number of the host server you set up (i.e. 5900+the number, 5901 for display :1) and ## is the port number you'd like to forward to (pick something between 0 and 99)
      • Save the session as something memorable in the Session configuration
  • Run a viewer on the client machine
    • Anywhere -> Most machines are not equipped with a viewer, so use a web-interface. Open a browser with Java and go to http://hostname:58XX/ where XX is the display number of the host server you set up, or http://ipaddress:58XX/ where ip address is the ip address of the host machine. This will only work for networks and machines without a million layers of protection. If you're going from windows server to linux client, this is the way to go.
    • UNIX: TightVNC java -> use the command "> java VncViewer HOST localhost PORT 59##"
    • Windows -> Run your client viewer to connect to localhost:## where ## is the port that you forwarded to in the previous step

Want your usual desktop?

  • Windows server-> automatically gives you control of the active desktop
  • UNIX/linux server -> edit the ~/.vnc/xstartup script (remove the comments from the two obvious places)

For more information on making the connection more secure, see here

Examples:

  • Remote desktop of lhcbedpc3.cern.ch on a windows laptop at CERN
    • Install TightVNC on your laptop
    • ssh tunnel into lhcbedpc3, using Cygwin, "> ssh -X -L 5964:127.0.0.1:5964 username@lhcbedpc3NOSPAMPLEASE.cern.ch"
    • edit the .vnc/xstartup script to use your normal desktop
    • start the vncserver "> vncserver :64 -geometry 1280x768"
    • Run TightVNC viewer, localhost:64
  • Remote desktop of lhcbedpc3.cern.ch on a windows laptop outside CERN
  • Remote desktop of blacksheep.ed.ac.uk on a windows laptop
  • Remote desktop of blacksheep.ed.ac.uk on lhcbedpc3.cern.ch
    • Install TightVNC java viewer in your afs area
    • tunnel through ph-ppe to blacksheep as above
    • run TightVNC viewer on the local machine (java) "> java VncViewer HOST localhost PORT 5964"
  • Remote desktop of windows home PC at CERN
    • Install TightVNC on your home PC and the TightVNC viewer on your afs area
    • Run a server on your home machine
    • find out your server's ip address, use a command window "> ipconfig" or by mouse-over the Vnc icon in the system tray
    • write down the ip address, send yourself an email or something so you remember it!
    • Run TightVNC viewer to ipaddress:5900 or 5901., "> java VncViewer HOST ipaddress PORT 5900"

Useful programs for windows/linux

  • WinSCP Secure Copying, nice interface.
  • GIMP, (java) image package, particularly useful for converting TO postscript/eps for windows
  • Emacs for windows
  • Ghost View for windows, particularly useful for viewing postscript
  • MiTeX latex compiler for windows
  • Eclipse fantastic all-singin-all-dancing IDE and TeX editor (java) for windows
  • JaxoDraw (java) draw Feynman diagrams and export as postscript
  • TightVNC (java) Remote Desktop across platforms


-- RobertLambert - 27 Dec 2006

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r6 - 2007-03-07 - unknown
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback