TWiki
>
Main Web
>
TWikiUsers
>
SimonMetson
>
SimonMetsonVMForStudents
(2010-11-30,
SimonMetson
)
(raw view)
E
dit
A
ttach
P
DF
%TOC% ---+ Preparation Prior to installing the VM you need to do the following: ---++ On Windows 1. Install VMPlayer - http://www.vmware.com/products/player/ ---+++ *Known Problems On Windows Vista* 1. If you have two network adaptors (e.g. ethernet and wireless) you may find that the VM binds to one while Vista is using the other for traffic. This will result in the VM seeing the outside network but the host OS (Vista) not being able to connect e.g. via putty. ---++ On OSX (Mac) 1. You need VMFusion, speak to Simon to get a free copy ---++ On Linux 1. Install VMPlayer - http://www.vmware.com/products/player/ ---++ Known problems The network adaptors can be confused. This results in your VM not being able to access the network. The symptom of this is that the VM's IP address isn't listed when running =myip= and eth0 network adaptor isn't listed in when running =ifconfig=. First of all make sure that the VMWare networking is set to *Host-only*. Then try to restart the networking: =service networking restart= If that doesn't bring the network back (still nothing from =ifconfig= for =eth0=) run =ifconfig -a=. This may show you a second network interface (=eth1=). If it's doing that the VM has bound the networking twice - very wrong. You can remedy this by doing: <verbatim> sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules_bak sudo reboot </verbatim> More info: http://muffinresearch.co.uk/archives/2008/07/13/vmware-siocsifaddr-no-such-device-eth0-after-cloning/ ---+ CompPhys VM ---++ Installing the VM 1. Download the VM image * http://www.phy.bris.ac.uk/groups/particle/courses/CompPhys.zip 1. Unzip it (more here...) 1. Open in VMPlayer/WMFusion * When opening the VM in VMPlayer/WMFusion you will be asked if you have "moved" or "copied" the VM - choose "moved" * You will probably see a warning about a missing file the first time you start the VM, don't worry about this. ---++ Restarting the VM If you keep the VM on the network drive (=U:=) or use it on different machines when you reload the VM it's likely to get confused. You should restart it as follows: =sudo reboot= This will let the VM reconfigure itself for the machine you have moved it to. Symptoms of this are: * 'Read only' file system * No network (running =ifconfig= does nothing) ---++ VM Contents Your VM should be loaded with: 1. Ubuntu OS 1. Python v2.6 * numpy * matplotlib 1. gcc v4.3.3 1. gnuplot ---+ Using your own computer ---++ Moving the VM around If you are moving the VM from home or your laptop onto the lab machines you will need to turn the VM off before moving it between machines. To do this run the following command: <verbatim> sudo shutdown -h now </verbatim> This will turn the VM off safely and close the VMWare app. ---+ Putting files onto your VM ---++ From a computer in 1.14 Your =U:= drive is mounted into the VM. You have access to all your files in =U:= via =/mnt/hgfs/your_shared_area=. You should probably make a directory under =U:= for the course (for example =compphys=) and then make a link through to the VM's home area using the following commands: <verbatim> cd #check you're in the home directory ln -s /mnt/hgfs/your_shared_area/compphys . </verbatim> Any files you put into your =U:= drive will be accessible from the VM, so write your code in Windows (using Notepad), save into U:/compphys and then run/compile in the VM. ---++ From your own laptop Using your own laptop is a bit more convenient for some people, but does mean you can't mount your =U:= drive into the VM. Here's how to get files in and out of your VM on your own laptop. ---+++ Windows 1. Download and install the following program: * [[http://winscp.net/download/winscp429.zip][WinSCP]] 1. Start the VM up and log in 1. Run =myip= at the prompt, this should print out a number (the VM's IP address) like =172.16.17.128= 1. Open the WinSCP program 1. In hostname put the number the =myip= program returned, username is =student=, password is =student123=. Click Save, then click Login * this should bring up a two panel window with the files on your computer on the left, and the files on the VM on the right. You can drag files into the right hand pane to transfer them into the VM and drag them from the right hand pane to copy them onto your laptop. You may find the VMWare player interface a bit annoying - no scrolling, copy and paste doesn't work. If you do: 1. Download and install the following program: * [[http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe][putty]] 1. Open putty up, connect it to the VM in the same way as WinSCP (use the IP address of the VM as host name etc.) * this should bring up a black prompt window, this is another view into the VM which is a bit more usable (you can copy/paste, you don't have to press Ctrl+Alt to switch out of the VM etc.) ---+++ Mac OSX and Linux As OSX and Linux are both derivatives of Unix you don't need to install additional programs to interact with the VM. Here's how you can connect to it from OSX/Linux: 1. Start the VM up and log in 1. Run =myip= at the prompt, this should print out a number (the VM's IP address) like =172.16.17.128= 1. Start the terminal application (on OSX this is in Applications/Utilities/Terminal, Linux you probably know where it is already...) 1. To log into the VM via the Terminal (handy if you have a non-UK keyboard layout, supports copy/paste) run =ssh student@172.16.17.128= (replacing =172.16.17.128= with the IP address =myip= returns), this will give you a prompt like the VM 1. To copy files from your laptop into the VM run =scp -r /path/on/laptop/to/the/file student@172.16.17.128:~/path/on/the/vm= 1. To copy files from the VM into your laptop run =scp -r student@172.16.17.128:~/path/on/the/vm /path/on/laptop/to/the/file= ---++ From the web Linux has a tool to fetch URL's from the web called =wget=, you can use it like so: <verbatim>wget http://www.google.com</verbatim> ---+ Plotting We provide a basic plotting script called cp_plot. It generates 2d plots and takes a list of data files as it's input to create the plot. Use it as follows: <verbatim> cp_plot --title 'my cool plot' datafile.txt </verbatim> This will make a file called my_cool_plot.png in your working directory. If you have multiple data series call the script as follows: <verbatim> cp_plot --title 'my cool plot' datafile1.txt datafile2.txt datafile3.txt </verbatim> The contents of your data files should look like: <verbatim> x (t), y (m/s) 1, 10 2, 15 3, 30 4, 17 5, 12 </verbatim> Note that the first line are the labels for the x and y axes. Each column is separated by a comma. If you decide you want to create more complicated plots you are on your own. The matplotlib [[http://matplotlib.sourceforge.net/gallery.html][gallery]] may be useful... ---++ Using it from a script You can reuse the code directly from a script as follows: <verbatim> from cp_plot import Plotter plotter = Plotter() plotter.plot(x=[1,2,3,4,5], y=[10, 15, 30, 17, 12], x_label='x (t)', y_label='y (m/s)', plot_title='my cool plot') </verbatim> This will make a file called my_cool_plot.png in your working directory. ---+ Simple Linux commands Linux commands generally behave as follows; they have a name (for instance =wget=) followed by options (for instance --no-check-certificate) followed by the thing the command runs on (e.g. the URL above). ---++ Moving around the file system Some basic commands follow: $ =ls=: list contents of the current directory $ =cd <dirname>=: change directory to <verbatim><dirname></verbatim>, if no <verbatim><dirname></verbatim> it'll take you back to your home directory $ =mkdir <dirname>=: create the directory <verbatim><dirname></verbatim> $ =rm thing=: delete thing - be careful there's no Recycling Bin, you run =rm= and the file is gone! ---++ Output redirection Linux lets you channel the output of one program into another or into a file. This is useful when you want to easily store the results from your programs. It's done like so: =my_program >> my_file= This will put all the output of my_program into my_file. *Be careful*, this will overwrite =my_file= without asking you first. If your program asks for input it *will not work* as the request for input may go into the file, and you'll not be able to provide input. ---++ Moving around on the prompt $ =ctrl + a=: go to the beginning of the line $ =ctrl + e=: go to the end of the line $ =ctrl + w=: delete a word ---++ Tab completion * type the first letter of the file you want/program to run * press tab - this will list all the things that begin with that letter, or add more letters until there's a choice (e.g. c -> ca if there'd car and cat) * repeat until the filename you want is there ---+ FAQ $ *I have no network access, what do I do?*: You need to delete the VM and start again from the zip file, make sure you click "move" when asked if you have copied or moved the VM. Make sure you have a copy of your work before deleting the VM. If this doesn't help ask a demonstrator.
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r31
<
r30
<
r29
<
r28
<
r27
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r31 - 2010-11-30
-
SimonMetson
Log In
Main
Home
Index
Search
User Search
Changes
Notifications
RSS Feed
Documentation
Support
Webs
Main
Main Archive
Plugins
Sandbox for tests
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
Main
All webs
Copyright &© 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