Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page describes setting up a local connection to an already-created Linux VM. 

Table of Contents

A virtual machine ("VM") is software that runs an operating system within a computer. For MRI analyses, we run Linux software on a windows computer. We install the virtual machine software (VMware), and that software runs Linux. The shorthand is "LinuxVM."

These pages are principally designed for the system administrator who will be creating the LinuxVM. If you are a user, you would typically start off with a large set of files that compose the LinuxVM.

Technical Note: For text files to be used in Linux, open as "t" to avoid the DOS double-charater CR+LF at the end of each line (CR = carriage return /r, LF = line feed /n). (http://www.mathworks.com/support/solutions/en/data/1-15HVX/index.html?product=SL&solution=1-15HVX link]
e.g., id = fopen(newfile.bat,'wt+');
The Linux command dos2unix will remove CR characters.

See bottom of page for updating.

...

Setting up Windows with LinuxVM

VMware

#Get and install "VMware Player" (free)#Enable "Virtualization Technology"#In the BIOS, you must make sure the option to run "Intel Vistualization Technology" (or similar in AMD) is enabled; here are some instructions:www.microsoft.com/windows/virtual-pc/support/configure-bios.aspx Microsoft Virtual PC pageYou will also need a 64-bit machine running 64-bit Windows.

Virtual Machine

Get the copy of the virtual machine (VM) you will use (or create your own using "VMware Workstation"). You will need the MRI software (FSL and FreeSurfer), the account name and password, and sshd service. There is a copy ("clone") on the Share drive:
LinuxCloneVM

Copy this to a local folder; I suggest C:\LinuxVM. You will need ~300GB. 

Download and install VMware Player (free).

Open VMware Player, and open the saved VM; select the copy option.

To test:
Start ("Play") the virtual machine

...

Setting up the connection

1-A. VMware settings (Player)

The network settings are already set in the copy of the VM, so all you need to do is look for the Subnet address. Go to the "Network and Sharing Center" in Control Panel, and click on the "VMnet1" connection, then click details, to find the Subnet Address (see snapshot):

Uploaded ImageImage Removed

1-B. VMware settings (WorkStation)This section NOT needed if you are using VMware Player'

Start by turning the VM off (under the "System" menu, select "Shut Down")

Set the network connection to Host to Host: in VMplayer, Edit Settings, Virtual Network Editor, VMnet1.
Select "Host-only" option, turn off "Use local DHCP service"
Make a note of the Subnet Address of VMnet1 (e.g., 192.168.65.0) and subnet mask (usually 255.255.255.0)

Note: I had to turn off the VNnet8, in Sep 2013 (Centos 6 and Workstation 10).

Under the VM Settings, select Network Adapter, select Connected + Connected at power on", "Host-only".

Uploaded ImageImage Removed

Video: Setting Linux Network Parameters (* Does not work in Internet Explorer)

***MISSING IMAGE***

2. Linux Settings

Start Linux - "play" or "resume" virtual machine
Log on (username is Paul)
In the Linux window, System => Administration => Network (you'll need to enter the password again, same as for Paul)
Select "eth0" in the Devices list, Edit
Set the IP address to be 100 on the subnet (e.g., 192.168.65.100), and set the subnet mask, and the "Default gateway address" will be the subnet address with a 1 at the end (example below).
Click "Activate"
Uploaded ImageImage Removed

Troubleshooting Linux Settings

Sometimes after an upgrade, there are changes to the network settings. 

sshd
To stop the slow SSH login, edit /etc/ssh/sshd_config (open a terminal, "su" to log on as super-user same password, cd to /etc/ssh, "gedit sshd_config) and add a like "UseDNS no, and make sure there are no DNS servers

Uploaded ImageImage Removed

3. Windows (matlab) settings

Install "PuTTY" - Google it and choose the Windows installer.
After installing, run once and connect to the IP address of the Linux VM; say Yes to add the certificate to the cache.
If you get a timeout error, start a Command Prompt and ping the IP address
e.g., C:\Users\Paul>ping 192.168.65.100
If you don't get a connection, re-check the above settings (and make sure you "Activate" the changes in the Network Configuration).

...

In the Centos 6+ version (since October 2013), the password is "data" (there is only one user, which you click). 

Note: since the machine is host-only, having the password visible does not matter since the machine cannot "see" or be seen by the internet.

You'll usually need to start a terminal (see black rectangle icon on top toolbar).
Type fsl to get FSL (Linux is case sensitive, unlike Windows)

Anchor
sharedfolder
sharedfolder
Shared folder

Choose a shared folder; I use one on the network, but something simple is good (e.g., "V:\LinuxShare\"). Avoid spaces in any Linux path.

Edit the VM settings, choose the Options tab, Shared Folders
Always enabled
"Add..." the folder

This will now show up in Linux (at least in CentOS) under /mnt/hgfs.

In Windows, change the folder permissions so that all users can modify, read and write.

Image Removed

Updating

To update:

...

Troubleshooting high disk usage

In 2015, the LinuxVM's started going crazy accessing the disk constantly, and killing the whole system. Here are some changes suggested:

Open the .vmx (configuration) file for the affected virtual machine while it is powered off. Add the following lines to the file using a text editor. For more information, see  Editing the .vmx file of a VMware Workstation and VMware Player virtual machine (2057902)
MemTrimRate = "0"
mainMem.useNamedFile = "FALSE"
sched.mem.pshare.enable = "FALSE"
prefvmx.useRecommendedLockedMemSize = "TRUE"

These pages describe how to create a new Linux VM.

Child pages (Children Display)

The key steps are:

  • Initiate instance in VMware Workstation 
  • Install OS
  • Install FSL and FreeSurfer
  • Change shell to tsch
  • Create tsch profile that sets FSL and FreeSurfer environment variables

The VM parameters are:

  • Set shared folder
  • Memory to max
  • Network connection to host-only (for local installations)

After an instance is placed on a local computer or network:

  • Set the network IP and other entries (be careful with DNS if host-only)

Other tidying can be to install MRIcron, and remove programs or services that are unused. For example, updates will not work for host-only.