VirtualBox Installation with Centos 7
Step 1: Retrieve and Install VirtualBox[edit | edit source]
Download and install the latest version of VirtualBox here for your platform.
Step 2: Start up VirtualBox and install Extension Pack[edit | edit source]
Once VirtualBox has been started up download and install the VirtualBox Oracle VM VirtualBox Extension Pack from here.
Step 3: Download the Centos 7 Virtual Computer VDI File[edit | edit source]
Download the CentOS 7 VDI Image from here. As of this writing it is minor version 1708. The file is a .rar archive file. Upon extraction, it should create a directory (~/Downloads/64bit) that contains a file called
CentOS 7-1708 (64bit).vdi
Step 4: Create a Centos 7 Virtual Machine within VirtualBox[edit | edit source]
In VirtualBox, click on "New" to create a new virtual machine. Assign a name to the virtual machine. The type should be "Linux", and the version should be "Red Hat (64 bit)". On the next screen, either accept the default memory size, or set it to at least 1 GByte. On the screen after that, choose the "Use an existing virtual hard drive", and then specify the CentOS 7-1708 (64bit).vdi that you downloaded in Step 3 above.
Step 5: Set up Local Account[edit | edit source]
Once Step 4 is completed, VirtualBox might boot your virtual machine automatically (if it does not, just press the "Start" arrow), and bring you to a Centos login screen. The first time, you need to login under the osboxes.org account. The password is osboxes.org. This is also the default root password.
Important note on screen capture of the mouse: We will fix this later, but in the initial setup, the mouse will be "captured" by the virtual machine, and you have to "escape" the mouse to get back to the regular screen of your host system. The key sequence for this depends on the host operating system. On Mac OSX, is is "Left Command Key + Mouse Click". On Windows 10, it is "Right Control Key + Mouse Click". For the moment, there will be instances where you will have to go back and forth between the host and the virtual machine, so you will have to know how to do this. Finally, the key sequence is also shown in the lower right corner of the VM window, in case it is different for your host operating system.
The first time that you log in, you will automatically be put into a set of windows dialogs where you choose the default language, keyboard, etc. Just choose the defaults.
After you have logged in, Applications->System Tools->Settings, and then click on the Users app.
To add a user, you will have to click the "Unlock" button at the top of the window, and then authenticate using the root password (osboxes.org). Click on "+" button on the left, and add a new local user, by specifying the full name, username, and password. IMPORTANT: choose to make this user an administrator!! Also, you might find it useful to make the username the same as your JLab username; it will make logging into your JLab account a bit easier later on.
Once you have done this, close the window, and then switch users to the new local account that you just created.
Step 6: Compile Kernel Modules[edit | edit source]
Before we can compile the Guest Additions kernel modules, we have to update a lot of packages, and install a few additional ones as well. Perform the following commands from within a terminal window (note that sudo will ask for your account password the first time):
sudo yum -y update
sudo yum -y install git make gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel
Now, power off the virtual machine, and reboot it. This will implement the new kernel that was just installed with the yum update command. We need to install two more packages before compiling the modules:
sudo yum -y install kernel-headers kernel-devel
Step 7: Addition VirtualBox Guest Additions CD Image[edit | edit source]
Along the top menu bar (Mac OSX), or along the top of the guest VM window, there should be a tab called "Devices". Within this pull down menu, choose to insert the Guest Additions CD image. This image has a script that will allow to compile a set of kernel modules that, when loaded into the kernel, will fix a lot of annoyances (like the mouse capture issue, and being able to resize the VM window size, among other things). You should see the VirtualBox Guest Additions CD on your Desktop if this was successful.
Now, double-click on the VirtualBoxGuestAdditions CD image on the Desktop, and then choose to "Run Software". This should ask you for your password, and then compile the modules. Yippee!!!
Step 8: Other Customizations of the Virtual Machine[edit | edit source]
Power off the virtual machine.
We will now add some nice customizations/features to the virtual machine, from within the Settings menu in the main VirtualBox window. Highlight the virtual machine that you just created, and then click on Settings.
General->Advanced ... set both Shared Clipboard and Drag'n'Drop to Bidirectional.
System->Processor ... the default is to only allow the VM to access 1 "core" on the host system. YOu may want to increase this to their suggested value, which is specified by the separation between green and red on that line.
Shared Folders ... it is quite useful to add, at the very least, the Downloads folder of your host operating system. In this way, you can download files on your host system, using your normal browser, and then have access to those downloaded files from within the VM. Click on the Folder icon on the right side, and add your Downloads folder. Make it automount, but DO NOT choose read-only!!!
Now, power up the virtual machine!
You should see that mouse pointer integration is now working properly, and you should be able to resize the VM window and have it adjust correctly to the newly sized window. You should also see a folder on your Desktop called "sf_Downloads", which is the Downloads folder on your host system.
Step 9: Fix Permission Problems[edit | edit source]
Even though we set things up with 'Access=Full' above, there is one remaining step to realizing that situation. We must add the local user to the vboxsf group. Carry out the following steps from a terminal window:
sudo vigr
and enter your password. This will take you into the system groups file. Use the down-arrow key to go to the bottom of the file, to the line that begins with vboxsf. You will need to add the local user account name to this line. Hit "i" to go into insert mode. Use the right arrow key to go to the end of the line, and add the local user account name. Hit "Ctrl+[" to get out of insert mode. Hit ":" to get to the command line mode of the editor. Type "wq" to save changes and exit.
We will now do the same thing to the shadow group file:
sudo vigr -s
and enter your password. This will take you into the system shadow groups file. Use the down-arrow key to go to the bottom of the file, to the line that begins with vboxsf. You will need to add the local user account name to this line. Hit "i" to go into insert mode. Use the right arrow key to go to the end of the line, and add the local user account name. Hit "Ctrl+[" to get out of insert mode. Hit ":" to get to the command line mode of the editor. Type "w!" to force the saving of changes (this is a read-only file so we have to force it). Then, type "q" to exit the file.
Log out of the Linux VM and then log back in. If you execute the command 'groups' from a terminal window that your local account will now below to the vboxsf group, as well as its own default group and the wheel group.
If desired, you can make a symbolic link in your home directory to the shared folder with:
cd
ln -sf /media/sf_Downloads HostDownloads
If you open the sf_Downloads icon on the Desktop, you should now see the Downloads folder on the host operating system. This will now allow you access to these files, and as well, you can put files created in the VM into this folder, and your host OS will have access to them!
Step 10: Installing ROOT6[edit | edit source]
I have stored a gzipped tar file of the CERN ROOT software under my home directory on jlabdaq. You can fetch this file from JLab with the following commands:
cd
scp [email protected]:/home/brash/root_tarfiles/root6.tar.gz .
where jlabdaquser is replaced with your jlabdaq username. You will need to enter your jlabdaq password when requested.
The final step involves unpacking and installing this gzipped tar file.
cd
su
cd /usr/local
tar -xvzf /home/localuser/root6.tar.gz
exit
where you would replace "localuser" with your local user account name. You will also have to enter the root password (osboxes.org) when prompted after the su command. NOTE!!! Don't forget to exit superuser mode at the end of this!!
Finally, you need to add a command to the .bashrc file in your home directory which sets up the ROOT environment:
cd
vi .bashrc
Add the following line to the bottom of this file, save, and exit.
source /usr/local/rootbuild/bin/thisroot.sh