Skip to content

Commit 413ff52

Browse files
authored
Move VM repo 2 SuperBuild (SyneRBI#620)
* moved SyneRBI_VM repo with history, under VirtualBox directory Co-authored-by: Kris Thielemans <KrisThielemans@users.noreply.github.com> Co-authored-by: Evgueni Ovtchinnikov <eeo@CCPPETMR> Co-authored-by: David Atkinson <D.Atkinson@ucl.ac.uk> Co-authored-by: Ben Thomas <ben.thomas1984@gmail.com> Co-authored-by: Ben Thomas <b.a.thomas@ucl.ac.uk> Co-authored-by: Kris Thielemans <k.thielemans@ucl.ac.uk> Co-authored-by: Kris Thielemans <kris.f.thielemans@hotmail.com> Co-authored-by: Richard Brown <33289025+rijobro@users.noreply.github.com> Co-authored-by: Casper da Costa-Luis <casper.dcl@physics.org> Co-authored-by: richard <richard.brown@ucl.ac.uk> Co-authored-by: johannesmayer <johannes.mayer@ptb.de> Co-authored-by: Edoardo Pasca <edo.pakino@gmail.com>
1 parent 9fd27e1 commit 413ff52

34 files changed

+1721
-1
lines changed

.gitattributes

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.txt text
7+
*.md text
8+
9+
# Declare files that will always have CRLF line endings on checkout.
10+
*.sln text eol=crlf
11+
12+
# Shell scripts should have LF
13+
*.sh text eol=lf
14+
*.csh text eol=lf
15+
16+
# Denote all files that are truly binary and should not be modified.
17+
*.png binary
18+
*.jpg binary

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ChangeLog
22
## vx.x.x
33

4+
- moved the VM repository to the `VirtualBox` subdirectory
45
- fix usage of `proj_EXTRA_CMAKE_ARGS` facility (it was broken for all projects except ITK) [#616](https://github.com/SyneRBI/SIRF-SuperBuild/issues/616)
56

67
## v3.1.1

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ You may add Your own copyright statement to Your modifications and may provide a
5050

5151
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
5252

53-
END OF TERMS AND CONDITIONS
53+
END OF TERMS AND CONDITIONS

VirtualBox/CHANGES.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# ChangeLog
2+
3+
# 3.1.0
4+
- update to SIRF 3.1.0
5+
- `update_VM_to_full_CIL.sh` is preferred way to install CIL. `CIL_LITE` is set to `ON` during SuperBuild.
6+
7+
# 3.0.0
8+
- build with python3
9+
- updated apt and python requirements for SIRF 3.0.0 and CIL v21.1.0
10+
- install [pet-rd-tools](https://github.com/UCL/pet-rd-tools)
11+
- add update_VM_to_full_CIL.sh script to use `BUILD_CIL=ON` in SuperBuild
12+
13+
# 2.2.0
14+
15+
- handle rename of project CCPPETMR->SyneRBI
16+
- add option to update system prerequisites with update_VM.sh
17+
18+
## 2.1.0
19+
20+
- added CIL prerequisites.
21+
22+
## 2.0.1
23+
- remove spyder-kernels
24+
25+
## 2.0.0
26+
- upgraded to Ubuntu 18.04
27+
- installs more recent Gadgetron https://github.com/gadgetron/gadgetron/commit/b6191eaaa72ccca6c6a5fe4c0fa3319694f512ab
28+
- add port forwarding (8888 -> 8888 for jupyter and 9001 and 9002 for Gadgetron)
29+
- install jupyter notebook, with default password 'virtual'
30+
- installs spyder v3.2
31+
- does not install a browser
32+
- add cython for CIL
33+
34+
35+
## 1.1.1
36+
- added nbstripout (https://github.com/kynan/nbstripout) to handle conflicts in SIRF-Exercises
37+
38+
## 1.1.0
39+
- added pip, firefox
40+
- added spyder and jupyer via pip
41+
- Virtual Machine is built with Virtual Box 5.2.12
42+
43+
## v1.0.0
44+
- Creation of VM is automated by a vagrant script, and a `first_run.sh` script to execute after the VM is up for the first time
45+
- `update_VM.sh` will now by default update to the latest release (of the SuperBuild). Options have been added to modify this.
46+
- updated base box to ubuntu-xenial64
47+
- Virtual Machine is built with Virtual Box 5.2.8
48+
49+
## v0.9.2
50+
- fixes to update script
51+
52+
## v0.9.1
53+
- Use SuperBuild as update mechanism

VirtualBox/HELP.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
This is a virtual machine with pre-installed versions of the CCP SyneRBI
2+
software SIRF and associated utilities.
3+
4+
Check https://github.com/SyneRBI/SyneRBI_VM/wiki for more information.
5+
6+
To get all software up-to-date, type
7+
8+
update_VM.sh
9+
10+
To run MR demos, first open a new terminal and type
11+
12+
gadgetron
13+
14+
Then open another terminal, change to
15+
16+
cd $SIRF_PATH/examples/Python
17+
18+
and check some of the examples (some info is in the README.md).
19+
20+
There are also examples for MATLAB, but MATLAB is not installed on this VM of course.
21+
22+
You can use SyneRBI Virtual Machine as a Gadgetron server if you cannot
23+
install Gadgetron on you computer (we ourselves have not yet succeeded in
24+
installing it under Windows). For this, you need to set up communication
25+
between your computer and VM in the following manner.
26+
27+
* Start Virtual Machine.
28+
29+
* Forward port 9002 to VM (in Oracle VM VirtualBox Manager: go to Settings->Network, click on Port Forwarding, add new forwarding rule by clicking on +, set Host Port and Guest Port to 9002).
30+
31+
* Open a new Linux terminal on VM and type 'gadgetron' there.
32+
33+
This will enable you to run SIRF MR demos on your computer.

VirtualBox/INSTALL.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# SyneRBI Virtual Machine: Installation and running of pre-built machine
2+
3+
If you have any problems, please first re-check this web-page. If you cannot solve your issue, please email syneRBI-USERS @ JISCMAIL.AC.UK
4+
5+
6+
## Initial download and installation
7+
This section assumes you want to use our pre-configured VM (which is recommended!). If you want to build a new VM yourself, then check the [README](README.md) for instructions.
8+
9+
1. Make sure you have enough free disk-space on your laptop (~10GB for installation).
10+
11+
2. Install VirtualBox (VB), our [Download page](http://www.ccpsynerbi.ac.uk/downloads) specifies the recommended version.
12+
(If it is older than the current default download from VB, you can [get an older version here](https://www.virtualbox.org/wiki/Download_Old_Builds)). Please note that this will require administrator permissions on your computer. The "host" operating system refers to your computer.
13+
You do not need to install the Oracle extensions to VirtualBox, although it might come in handy for USB support.
14+
Although other Virtual Machine software might work, we have not tried this and will not be able to help to get this going.
15+
Some extra pointers if you experience problems with installing VirtualBox
16+
- On older Ubuntu versions (e.g. 15.10), there were some problems installing VirtualBox related to `libvpx`, [check here for some help](https://forums.virtualbox.org/viewtopic.php?f=7&t=74050).
17+
- If your VirtualBox is too old, you might experience problems with networking etc. Please use at least 5.0.40 (at least 5.2.6 on a Mac).
18+
19+
For Macs, the installation of Virtual Box might require you to alter your security settings.
20+
- If you receive an error along the lines of `kernel driver not installed (rc=-1908)`, the following might help. Click on the Apple icon in the top-left of your screen and then `System Preferences->Security & Privacy->General`. Click the padlock in the bottom-left and enter your password to be able to make changes to this page. Click `Allow` next to the Virtual Box text. Hopefully the problem will have been sorted.
21+
- If the installation takes you directly to the `Security and Privacy` window, select `Allow` (the VB is labelled as from Oracle). When the installer asks if it should Move to Trash, say `Keep` because you need to re-run the installation again with this revised security setting. Second time around, you can move it to trash.
22+
23+
3. Download the preinstalled virtual machine from http://www.ccpsynerbi.ac.uk/downloads.
24+
Warning: this file can be ~4.9GB. (You can download to a USB stick or hard drive to save space on your hard-disk).
25+
26+
4. Open the downloaded OVA file (double-click or whatever is appropriate for your system). This should start VirtualBox with the "Import" dialog box.
27+
28+
5. Change settings of the virtual machine (you can still change this afterwards by using the Settings menu of VirtualBox). The only things that need your attention:
29+
- CPU: use the same number of CPUs (i.e. cores) as your laptop (or 1 less)
30+
- RAM: use about half the RAM of your laptop (assigning too much RAM will slow down your laptop dramatically, using not enough will slow down the virtual machine. 1.5GB seems to be enough for most things though.)
31+
- Virtual Disk Image: normally this filename is fine but you can save it somewhere else if you like
32+
33+
6. If still present, tick the box "Reinitialise the MAC address of all network cards"
34+
35+
7. Press Import and wait for a few minutes (everything will be decompressed etc).
36+
37+
8. In the VirtualBox window, select your new VM and press the Settings icon. In the "General" category, "Advanced" tab, check that "Shared Clipboard" is set to "bidirectional".
38+
39+
## Initial configuration of the virtual machine
40+
41+
Now you can start your virtual machine. If it fails to start with an error like "*virtualbox vt-x is disabled in the bios*", [check here](http://www.howtogeek.com/213795/how-to-enable-intel-vt-x-in-your-computers-bios-or-uefi-firmware/).
42+
If you see a dialog box about "starting in scaled mode", you can press OK to allow VirtualBox to scale the display larger or smaller, or you can press Cancel and start the machine again without scaling. (See [the Virtualbox site](https://www.virtualbox.org/manual/) for some info on the Host-Key etc).
43+
44+
1. You should get a window where Ubuntu 18.04 will be starting (might take a few minutes). Wait until you see the log-in prompt.
45+
46+
2. Log in as user "sirfuser" with password "virtual" (please note that the default keyboard is with `en_GB` locale: if you have an Azerty-type keyboard, you will have to type "virtuql" until you change your VM keyboard settings). You should get the Gnome3 desktop.
47+
48+
3. Adjust your Ubuntu settings:
49+
- Default settings should allow you to access the internet from in the virtual machine.
50+
If not, please check [the Virtual Box documentation](http://www.virtualbox.org/manual/ch03.html#settings-network).
51+
- The keyboard type is set to English-UK. There are currently a few preinstalled layouts, including en_GB, en_US, Portuguese, Spanish etc.
52+
You can change keyboard-type by clicking on the relevant icon in the top-right of the VM.
53+
If you cannot find the layout that you need (e.g. to switch to a Mac keyboard), open a terminal by clicking "Activities" at top left and type "terminal" in the search box, then use
54+
55+
```
56+
sudo dpkg-reconfigure keyboard-configuration
57+
```
58+
59+
- To adjust other system settings you can click on the right top corner and then click on the tools icon (spanner and screwdriver) to start the settings app, or click on "Activities" on the top left corner and then type "settings" in the search box and it should open the settings apps. If the text and windows are so large it makes using the settings app difficult, try changing the scaling by pressing the small display icon near the bottom right of the VB window.
60+
61+
4. The VM has been created with a particular version of Virtual Box (see the Download page) and with the [VirtualBox Guest Additions](https://www.virtualbox.org/manual/ch04.html) (VGA) pre-installed. If you have a different (or even the same) version of Virtual Box you might experience [issues](https://github.com/SyneRBI/SyneRBI_VM/issues/9), especially [running the X server](https://github.com/SyneRBI/SyneRBI_VM/issues/60#issuecomment-367611385). If you are using a different version of VirtualBox we therefore strongly recommend to sync your VGA version as follows:\
62+
In the menu-bar of the window that contains your VM, click on "Devices" and then "Insert Guest Additions CD". (On a Mac, with the VM window selected, this menu bar is at the top of the screen). If this generates a window inside your VM to run the software on this "CD", say OK. Otherwise, type
63+
64+
```
65+
sudo /home/sirfuser/devel/SyneRBI_VM/scripts/update_VGA.sh
66+
sudo shutdown -r now
67+
```
68+
The VM will reboot. (You will have to do this again if you upgrade your VirtualBox version).
69+
70+
5. On old VM versions (e.g. 20 April 2018, SIRF_1.0.0) people were reporting problems after the VM is shutdown or rebooted, but this problem no longer seems to exist. The VM windows system may fail to start and you are left with a flashing VM terminal window that stabilises after a few minutes. If your cursor has gone, it may be "in" this terminal window and can be released (press the Host Key (on most systems, right-ctrl, on a Mac the Apple command key). To restore proper functionality, follow the instructions in point 5 above, even if you already had the correct VGA installed. If you have previously 'inserted' the CD you may get an error message that you need to ignore. Then reboot.
71+
72+
## Usage
73+
Check our [wiki](https://github.com/SyneRBI/SyneRBI_VM/wiki) for usage instructions.
74+
75+
## How to shut down the VM
76+
77+
To shut down your VM when you are finished with it, use one of the following options.
78+
79+
1. Close the VM window and use "save machine state" (allowing you to resume from where you were).
80+
2. Shutdown the VM via the Ubuntu interface (arrow in top-right corner), or close the VM window
81+
and use "Send the shutdown signal".
82+
(It is not advisable to "power-off" the VM as that can leave the file system of the VM in an undefined state).
83+
3. Use the VirtualBox main window to do any of the above.
84+
85+
## Shared folders
86+
87+
This section is optional.
88+
89+
Warning: in VB versions before 6.0.6, we strongly recommend to copy data from a shared folder to a “local” folder (in your VM) to avoid a problem with [a VB bug](https://www.virtualbox.org/ticket/9485).
90+
91+
After installing the VGA, you might want to configure a shared directory between the host and the guest machine such that your virtual machine can "see" your "normal" files. Please read [the Virtualbox documentation on Folder Sharing](http://www.virtualbox.org/manual/ch04.html#sharedfolders).
92+
Summary of steps (courtesy Nikos Efthimiou):
93+
94+
1. Right click on the SyneRBI VM in VirtualBox main window and choose Settings.
95+
2. Choose "Shared Folders".
96+
3. Add new folder (use small + button near the right edge of the dialog), select the folder you want, and give it a name, e.g. MyLaptop.
97+
4. Select folder and check "make permanent" and "auto mount".
98+
5. Start the SyneRBI VM (or switch to it) and open a terminal and type
99+
100+
mkdir ~/MyLaptop
101+
sudo mount -t vboxsf -o rw,uid=1002,gid=1002 MyLaptop ~/MyLaptop
102+
The '1002's in the above refer to the user and group ids of the user. These are not always 1002 - to check, at the command line, type the command `id`.
103+
104+
You will have to type the last command whenever you reboot your VM, or you could make this permanent by pasting the above command to /etc/rc.local before "exit 0" (non-trivial because of admin permissions).
105+
106+
If you want you can unmount the folder by typing
107+
108+
sudo umount -t vboxsf MyLaptop
109+
110+
## Using the VM as server
111+
112+
See [here](https://github.com/SyneRBI/SyneRBI_VM/blob/master/Using_VM_as_server.md)

VirtualBox/NOTICE.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CCP SyneRBI Virtual Machine
2+
Copyright 2016-2020 Rutherford Appleton Laboratory STFC
3+
Copyright 2016-2020 University College London (UCL)
4+
5+
This software product is developed for the Collaborative Computational
6+
Project in Synergistic Reconstruction for Biomedical Imaging,
7+
formerly CCP PETMR, (http://www.ccpsynerbi.ac.uk/)
8+
at RAL STFC (http://www.stfc.ac.uk), UCL (http://www.ucl.ac.uk/)
9+
and other contributing institutions.
10+
11+
Main contributors (see each file for authors):
12+
Evgueni Ovtchinnikov (STFC)
13+
Kris Thielemans (UCL)
14+
Benjamin A Thomas(UCL)
15+
Edoardo Pasca (STFC)

VirtualBox/README.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# CC SyneRBI Virtual Machine: Build your own VM
2+
3+
This project contains a series of files and scripts to create and install a virtual machine running [SIRF](https://github.com/SyneRBI/SIRF) and its prerequisites. If you just want to download and use a pre-built VM, it can be downloaded from our [website](http://www.ccpsynerbi.ac.uk/downloads), just check the
4+
[installation instructions](INSTALL.md) and our [wiki](https://github.com/SyneRBI/SyneRBI_VM/wiki)
5+
for basic usage.
6+
7+
The remainder of this file documents how to build your own VM.
8+
## Prerequisites for machine creation
9+
10+
To create a new VM yourself, you need to have both [Vagrant](https://www.vagrantup.com) and [Virtual Box](https://www.virtualbox.org) installed on your machine.
11+
12+
## Machine creation
13+
14+
Clone our repository and launch vagrant in the vagrant directory. In windows you should be running something like MinGW terminal, not the windows command line.
15+
16+
vagrant plugin install vagrant-vbguest
17+
vagrant up
18+
19+
The pre-built Ubuntu machine is downloaded and then configured. Virtual Box should be launched and you should see it appearing. After this first phase you should be able to launch
20+
21+
vagrant provision
22+
23+
That will finish up the creation steps.
24+
25+
Refer to [here](https://github.com/SyneRBI/SyneRBI_VM/blob/master/INSTALL.md) for further informations and instructions.
26+
27+
## Pre-built downloads
28+
A pre-built VM with SIRF installed is currently available at [www.ccpsynerbi.ac.uk/downloads](www.ccpsynerbi.ac.uk/downloads). The page states which version of VirtualBox was used to create it.
29+
30+
### Pre-built VM final steps
31+
When building the official prebuilt VM with SIRF pre-installed, we follow the steps above.
32+
Additionally we run the script `first_run.sh` which
33+
34+
1. changes some settings of the gnome desktop environment
35+
2. compacts the size of the appliance. This step involves filling the virtual hard drive with an enormous file followed by its removal.
36+
37+
Users are **not required** to run the `first_run.sh` script. However, you then probably want to run the `configure_gnome.sh`script
38+
which does the gnome configuration.
39+
40+
### Notes on CUDA
41+
42+
Although this does not apply to the VirtualBox VM, these scripts are being used to create VM on the cloud.
43+
We found that the appropriate CUDA toolkit to install is 10.1, by following [these](https://github.com/SyneRBI/SIRF-SuperBuild/issues/273) instructions:
44+
45+
#### Uninstall CUDA
46+
47+
sudo /usr/local/cuda-X.Y/bin/uninstall_cuda_X.Y.pl
48+
sudo /usr/bin/nvidia-uninstall
49+
sudo apt-get --purge remove nvidia*
50+
sudo apt-get --purge remove cuda*
51+
sudo rm -r /usr/local/cuda-X
52+
sudo reboot
53+
54+
#### Install CUDA 10.1
55+
56+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
57+
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
58+
wget https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.168-418.67_1.0-1_amd64.deb
59+
sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.168-418.67_1.0-1_amd64.deb
60+
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
61+
sudo apt-get update
62+
sudo apt-get install cuda
63+
sudo reboot
64+

VirtualBox/Using_VM_as_server.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Using the VM as server
2+
3+
As of SIRF 2.0.0 we enable [port forwarding](https://github.com/CCPPETMR/CCPPETMR_VM/blob/master/vagrant/Vagrantfile#L36L38) on
4+
the VM by default:
5+
6+
| Service | Host Port | Guest Port | Protocol |
7+
|---------|-----------|------------|----------|
8+
| jupyter notebook | 8888 | 8888 | TCP/IP |
9+
| Gadgetron | 9001 | 9001 | TCP/IP |
10+
| Gadgetron | 9002 | 9002 | TCP/IP |
11+
12+
## Gadgetron server
13+
You can use SyneRBI Virtual Machine as a Gadgetron server if you cannot install Gadgetron on you computer (we ourselves have not yet succeeded in installing it under Windows).
14+
15+
1. Start Virtual Machine.
16+
1. Open a new terminal on the VM and type `gadgetron` there.
17+
1. Keep the VM running and run Python or Matlab on your normal computer.
18+
19+
This will enable you to run SIRF MR demos on your computer.
20+
21+
## Jupyter Notebook
22+
23+
A [jupyter notebook](https://jupyter.org/) server is installed in the VM it can be started as:
24+
25+
1. open a terminal in the VM
26+
2. type `jupyter notebook`
27+
3. in the host, open a browser and point to `http://127.0.0.1:8888`
28+
4. (optional) you may need to start Gadgetron, as above

VirtualBox/VM_version.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1.0

0 commit comments

Comments
 (0)