Networking and Distributed Computing Systems Lab Setup Guide

Slide Note
Embed
Share

Set up your lab environment for networking and distributed computing systems using Unix, Bash, and Emacs. Learn to access lab machines via SSH, use PuTTY and Terminal for communication, simulate Linux environment on Windows with Cygwin, run different OS on VMware Player, download and install Linux on VMware, access lab from outside using VPN, and manage passwords on machines efficiently.


Uploaded on Oct 08, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Precept I : Lab Environment, Unix, Bash, Emacs 2012.09.05. NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB

  2. Lab Environment (Linux) Lab machines are administered by TA IP address range (12 machines) 143.248.141.52 ~ 143.248.141.63 Use SSH protocol to communicate with the lab machine PuTTY (Windows) Terminal (Mac OS) ID Your student number Password Your student number NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 2

  3. Cygwin Provide Linux-like environment in Windows http://cygwin.com/install.html Install Cygwin Download & run setup.exe Choose any URL to download files NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 3

  4. VMware Player Run another OS (Linux, Windows, etc.) on top of main OS https://my.vmware.com/web/vmware/free#desktop_end_user_computi ng/vmware_player/5_0 Install VMware Download VMware Player for Windows 32-bit and 64-bit Run downloaded file NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 4

  5. VMware Player Download Linux (Ubuntu) image file http://www.ubuntu.com/download/desktop Install Linux on VMware Click on Create a New Virtual Machine Click on Browse button Add image file downloaded from website Insert information : username, password, etc. Press Play virtual machine button NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 5

  6. Accessing from Outside KAIST Require virtual private network (VPN) program At first run, use Internet Explorer! kvpn.kaist.ac.kr Log in Press Start NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 6

  7. Change Password on All Machines! Connect to the machine with default ID & PASSWORD Type passwd In response to (current) UNIX password: , type current password In response to New password: , type new password. In response to Retype new password: , type new password again. Reminder Each machine does not share files It is your responsibility to back up your files Keep the code locally Use the lab machines only for testing and debugging NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 7

  8. Unix and Bash NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 8

  9. Bash Commands For details, read the handout Most useful commands Command man <function name> cd <directory name> ls [-al] mkdir <directory name> rmdir <directory name> less/cat/more <file name> cp <source> <target> mv <source> <target> Description open manual page change directory list files in the directory make directory remove directory print file content copy source file to target rename source file to target NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 9

  10. Emacs Popular editor Integrated with GCC compiler driver & GDB debugger Already installed in lab machines emacs test.c NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 10

  11. Emacs Hotkey Hotkey Ctrl-k Ctrl/alt-w Ctrl-y Ctrl-x Ctrl-s Ctrl-s/r <string> Ctrl-x Ctrl-f <file> Ctrl-x 2/3 Ctrl-x o Ctrl-x 1/0 Ctrl-x u Ctrl-g Ctrl-x Ctrl-c Description cut line cut/copy region paste copied/cut region save file search/recursive string open file Split window vertically/horizontally move to different window close other/this window undo abort command close emacs NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 11

  12. Building C Programs hello.c Source code C language Contains preprocessor directives #include <stdio.h> int main(void) { printf("hello, world\n"); return 0; } Preprocess C Preprocessor gcc209 E hello.c > hello.i hello.i Source code C language Contains declaration of printf() Missing definition of printf() int printf(char *format, ) int main(void) { printf("hello, world\n"); return 0; } NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 12

  13. Building C Programs Compile gcc209 S hello.i C Compiler hello.s Source code Assembly language Missing definition of printf() .section .rodata cGreeting: .asciz hello,world\n .section .text .global main .type main, @function main: puchl %ebp movl %esp, %ebp pushl %cGreeting call printf addl $4, $esp movl $0, %eax movl %ebp, %esp popl %ebp ret NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 13

  14. Building C Programs hello.o Object code Machine language Missing definition of printf() Assemble gcc209 c hello.s Assembler .100101000110100 11110010000010100 Link Linker gcc209 hello.o lc -o hello hello Machine language 001010000101000000111110 gcc209 is an abbreviation for gcc Wall ansi pedantic m32 march=i386 Shortcut: gcc209 hello.c o hello NETWORKED & DISTRIBUTED COMPUTING SYSTEMS LAB 14

Related