Remote X Tutorial
来源:互联网 发布:java api 1.6汉化版 编辑:程序博客网 时间:2024/05/17 02:16
In this class, we're using the open source, UNIX-like operating system known as Linux for all of our development. For most, the transition from developing in Visual Studio or Eclipse to developing in UNIX is rough, at best. All of a sudden, you have to learn a slew of new commands just to be able to access your files, and on top of that, you have to learn the ins and outs of a new editor, Emacs. While it's helpful to go to the cluster and work directly on the machines using Emacs in a graphical window, it isn't always convenient. In this tutorial, I'll explain how to bring the UNIX environment on Stanford's machines to your own computer, as if it were running natively on your computer. That way, Emacs will appear as another window on your screen, just as if it were a graphical word processor on your system. The steps I detail are cleaner and faster than VNC, an alternative way of connecting to Stanford's machines graphically. Obviously, you still have to learn the UNIX commands, but this will definitely make your life a bit easier. Feel free to stop by my (Ryan's) office hours anytime if you run into trouble with these directions.
The basic idea of what we're doing is as follows. In UNIX, graphical applications are commonly run on top of a system known as X. X was designed for a "client/server" model which means the computer that stores and runs the application does not have to be the same computer that is displaying the application to the user. In this tutorial, we will show you how to run a UNIX terminal from a Stanford cluster computer on your very own machine. This terminal can then be used to explore your code and launch your editor (here we use Emacs).
Note that in this tutorial I assume you're using the 'myth' cluster of workstations. These are the workstations located in room B08 of the Gates basement. The Myth machines are a personal favorite of mine due to all of MY happy 107 memories, but these instructions also work for the other farmshare computers such as 'corn' and 'barley'. To use an alternate cluster, simply substitute its name wherever you see 'myth'.
To begin, select your operating system.
- Windows
- MacOS X
- Linux (any flavor)
Windows XP/Vista/Win7:
Here we will download and install an open source program known as Xming, which is an implementation of X for Windows.
- Click here to download the installer for Xming.
- You should be able to run through the installer with the default values. At the end it should summarize the install like this:
Click install and let it do its thing. - After it's done, it should have created an entry for 'Xming' in your Start menu. Go into the folder and click 'XLaunch' to bring up the wizard that will let you create a shortcut to launch the remote terminal.
- Select the default 'Multiple windows'
- On the next screen, select 'Start a program'
- Next, type 'gnome-terminal' (yes...gnome) as the program to start. Then select 'Using PuTTY (plink.exe)'. Enter 'myth.stanford.edu' as the computer to connect. Finally, type your SUNet ID (ie jsmith) with your password. (XMing won't accept a password longer then 14 characters here, but just leave the password field blank, and you will be able to type it in later when you launch.) Then click next.
- The next screen should look like the picture below. Just click next.
- On the next screen, click 'Save Configuration'. In the window that pops up navigate to your desktop and type the filename 'myth.xlaunch' as shown in the picture. Then click save and finish the XLaunch wizard. Notice that it has placed a shortcut to launch the remote terminal on your desktop.
- For some people, Xming will launch itself and start running in the background after the installer completes. If this is the case, launching the shortcut will ask you for your password and then do nothing. Before going on to the next step, ensure that there is not a little black and orange X in the system tray at the bottom right of your screen.
- Launch the shortcut ('myth.xlaunch') on your desktop. It should probably ask you for your password again. Enter it and after a few seconds a terminal something like the one below should appear.
- Congratulations! You've got your spiffy new remote X terminal working. Please proceed to the section entitled 'What to do with your shiny new X Terminal'.
MacOS X
The cool thing about OS X is that it's build on UNIX. That's right...all of you cool Mac people are already even cooler UNIX people and you probably didn't even know it! Because of this, it's pretty simple to get X working on MacOS X.
- If you don't already know, check what version of OS X you're running by clicking the Apple menu and selecting 'About This Mac'.
- The good news is, if you're running 10.5 (Leopard) X most likely was installed by default when your operating system was installed. You can open the Terminal from Applications/Utilities and skip to Step 3. If you're running 10.4 (Tiger) then follow the directions here and afterwards launch your X terminal by opening 'X11' from Applications/Utilities. Continue on to step 3 with the 'xterm' window that shows up in place of the standard OS X Terminal.
- By this point, you should have an X enabled terminal in front of you. Now we're going to log into a Stanford machine. Type 'ssh -Y your_sunet_id@myth.stanford.edu' (without the quotes and with your SUNet in the right spot). The picture below gives the general idea. Type 'yes' if asked to accept a public key (this connection is encrypted!) and type your password when prompted (don't worry if nothing shows up on the screen when you type your password).
- Congrats! You've logged in. Please proceed to the section entitled 'What to do with your shiny new X Terminal'
Linux
If you're already running Linux (hooray for you!) then it's super easy to remote into Stanford's machines.
- Open up a terminal (in Ubuntu/Debian it's under Applications/Accessories).
- To log into Stanford's machine, just type 'ssh -Y your_sunet_id@myth.stanford.edu' (without the quotes and with your SUNet in the right spot).
- Type 'yes' if asked to accept a public key (hooray for encryption!) and type your SUNet password when prompted (don't worry if nothing shows up on the screen when you type your password).
- Your whole session should look something like this:
What to do with your shiny new X Terminal
Now, by whatever method, you've got a fully functional X enabled terminal in front of you. Here you can do all of the UNIX commands for moving around the computer and running programs.
- Type 'xcalc&' (with the & at the end) to open a simple calculator. The '&' at the end tells a program to run in the background. This is useful if you're running a graphical application as it gives you back control of the terminal after the application opens.
- The picture below illustrates how to open Emacs, a powerful but not entirely intuitive text editor for coding. To open a file named 'myfile.c' in emacs just enter the command 'emacs myfile.c&'.
- Emacs launched in this way looks something like this (depending on your OS).
- That's it! Look back on the main site for further documentation of Emacs and the bountiful joys of coding in UNIX!
- Remote X Tutorial
- github tutorial--remote operations
- BlazeDS Tutorial – Remote Object Service
- X Over SSH2 - A Tutorial
- 1 Spring4.x Learn Tutorial
- mysql 5.x remote exploit video
- centos remote control server 6.x
- Cordova (aka PhoneGap) 3.x Tutorial
- NSTask Tutorial for Mac OS X
- Cocos2d-x Tutorial C++ 类到 Lua
- OS X View Controllers Tutorial学习笔记
- tutorial
- Tutorial
- Tutorial
- MSN messenger 7.x (8.0?) VIDEO Remote Heap Overflow Exploit
- IMail iaspam.dll 8.0x Remote Heap Overflow Exploit
- 修改remote desktop connection for Mac OS X的端口
- Remote IIS 5.x and IIS 6.0 Server Name Spoof
- 条件锁(条件Mutex)pthread_cond_wait、pthread_cond_signal、pthread_cond_broadcast的使用[转]
- JAVA深复制(深克隆)与浅复制(浅克隆)
- VB修改IE UserAgent方法,怎么修改浏览器UserAgent
- 网上支付心得2-网上支付案例payment
- String类的常用方法
- Remote X Tutorial
- Js中的单引号与双引号
- 条件变量
- iPhone网络开发之如何使用NSURLConnection
- PuTTY + Xming 远程使用 Linux GUI
- many-to-one/one-to-many/many-to-many关系映射 (Hibernate)
- You must restart adb and Eclipse问题的解决
- Android数据存储方式(三)SQLite数据库
- Linux 套接字编程中的 5 个隐患