linux-virtual-machine-image

Linux Virtual Machine Image

This virtual machine image is configured with nearly all the software we provide on the open lab machines. Some of the software we have, such as VMWare and the JetBrains software suite, is proprietary software that we can only legally install on BYU-owned computers. However, this machine image does include a number of useful development tools, such as Android Studio, GCC, Java, Python, Eclipse, and Atom. This is designed to run on your personal computer in Oracle VirtualBox.

If you already know how to import and use a VM, you can download it here. (Note that this file is about 10 GB, so depending on your connection speed, it could take several hours to download.) If you’re not familiar with this process, continue reading and we’ll walk you through it.

  • OS: Xubuntu 18.04 LTS 64-bit
  • Hostname: labimage
  • Username: student
  • Password: student
  • Allocated resources:
    • CPU: 2 cores / threads
    • RAM: 4 GB (4096 MB)
    • VRAM: 16 MB
    • Storage: 60 GB virtual hard disk (dynamically allocated, should be about 20 GB after importing the VM)

This virtual machine will run on just about any computer, however, on low-end computers it will perform poorly, as it will basically need to run two computers at the same time. For optimal performance, we recommend the following minimum specs:

  • CPU: 4-thread Intel Core i5 or AMD equivalent
  • RAM: 8 GB
  • Disk space: 60 GB
  • Display: 1280×720
  • OS: 64-bit; Windows 10, Mac OSX 10.10, Ubuntu 18.04, Fedora 25, openSUSE 13.2
  • Virtualization software:
    • Recommended: Oracle VirtualBox (free and open source, available at https://virtualbox.org)
    • It should run in other programs like VMWare, but you would need to provide your own license. Depending on your major, you may be eligible to get a free license through BYU for your own use.

The intent of the Linux VM image is to give the user a computing environment that aligns as closely as possible to the computing environment on any lab machine. This includes matching not only the development and other software tools available on the lab machines, but also the kernel and configuration. For some classes (e.g., CS 224 and CS 324), duplicating this environment is critical. This includes not only the kernel itself (i.e., Linux instead of MacOS, FreeBSD, or even Windows Subsystem for Linux), but also the kernel version (i.e., Linux 4.15 vs. Linux 3.13). For other classes, access to the software is what matters most. In this latter case, one option more efficient than running a VM might be to install the free/open source software on your Linux host instead.

Free Software

The following links are some of the software that can be downloaded and installed for free.
Android Studio
GCC
Java
Python
Eclipse
Atom
Visual Studio Code

  1. Download, install, and run VirtualBox
    1. At the top of the window, click “New” (we won’t actually create a new VM, but this is an easy way to test for virtualization support)
    2. Open the “Version” drop-down menu and look at the options available:
      1. If you see both 32- and 64-bit options, then virtualization is already enabled - continue to the next section in these instructions
      2. If you only see 32-bit options, then virtualization is not enabled - go to the Hardware Virtualization page for specific instructions

Using VMWare (requires you to provide a license)

These instructions are based on VMWare Player and may be slightly different for other VMware products
  1. Download, install, and run VMWare (you can get possibly get a license from BYU)
    1. Click “Create new Virtual Machine”
    2. If it asks about the “Virtual Machine Configuration”, just accept the default and click Next
    3. Select “I will install the OS later” and click Next
    4. Open the “Version” drop-down menu and look at the options available:
      1. If you see options with “x64” at the end, then virtualization is already enabled - continue to the next section in these instructions
      2. If you do not see any “x64” options, then hardware virtualization needs to be enabled - go to the Hardware Virtualization page for specific instructions

Using VirtualBox (recommended)

The virtual machine file is about 10 GB, so depending on your connection speed, it could take several hours to download.
  1. Download the .ova file here
  2. Open VirtualBox and select File > Import Appliance
  3. Locate and select the .ova file you downloaded in Step 1
  4. Review the settings and change them as needed
    1. Definitely check the box that says “Reinitialize MAC address of all network cards”
    2. Feel free to change the name of the VM to whatever you’d like to see when you launch it
    3. If your computer only has two processing threads, consider decreasing the CPU value to 1. If you have a lot of processing threads, you can increase this number
    4. If your computer has less than 8 GB of RAM, consider decreasing the RAM value to no more than half your total system RAM. If you have a lot of RAM, you can increase this number
    5. The last line is the location of your virtual machine files, including the virtual hard disk. Note that these files should be about 20 GB to start with, but may grow up to 60 GB. Choose a location with plenty of free space
    6. Leave the other settings alone unless you know what you’re doing
  5. Click “Import” (and wait for a few minutes while it imports)
  6. You can now start your new virtual machine from the main window in VirtualBox
  7. This virtual machine has the VirtualBox Guest Additions preinstalled, which provides useful functionality like dynamic resizing of the virtual display and shared folders between the host and guest. However, updating the virtual machine’s kernel may cause issues with this software. If this happens, try running this command:
     sudo apt install virtualbox-ose-guest-utils virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms 

Using VMWare (requires you to provide a license)

These instructions are based on VMWare Player and may be slightly different for other VMware products
The virtual machine file is about 10 GB, so depending on your connection speed, it could take several hours to download.
  1. Download the .ova file here
  2. Open VMWare and select “Open a Virtual Machine”
  3. Locate and select the .ova file you downloaded in Step 1
  4. Choose the name and location for the VM.
    1. Note that these virtual machine files should be about 20 GB to start with, but may grow up to 60 GB. Choose a location with plenty of free space
  5. Click “Import” (and wait for a few minutes while it imports)
    1. The import may fail due to some compliance checks. Click retry and it will make those checks less strict. In our testing, it worked after retrying once
  6. Once the import is finished, change some settings if needed
    1. If your computer only has two processing threads, consider decreasing the Processor Cores value to 1. If you have a lot of processing threads, you can increase this number
    2. If your computer has less than 8 GB of RAM, consider decreasing the Memory value to no more than half your total system RAM. If you have a lot of RAM, you can increase this number
  7. You can now start your virtual machine from the main window
  8. Since we built this image in VirtualBox, we have the guest software for it pre-installed in the image. VMWare has its own software to allow for resizing the virtual display and sharing files between the host and guest. Follow these instructions to install VMware tools.
VMware tools will need to be reinstalled any time the virtual machine’s kernel is updated

After downloading and setting up the VM, we highly recommend running package updates. This requires two commands - one to update the package lists, the second to download and install the latest version of the packages:

sudo apt update
sudo apt upgrade

Desktop environments

As with the lab computers, you can select a desktop environment to use when you’re logging in, by clicking the button to the right of the username. However, unlike the lab computers, it will default to whatever desktop environment you used last. It has all the desktop environments present on the lab computers, with one addition. We used to have KDE Plasma as the default for the lab computers, but it did not play nicely with how we set up our lab computers. But since this virtual machine image doesn’t need to interact with any of our servers, we have included Plasma on this virtual machine image. You can use it if you like, although it might not be as stable as the other options.

And, of course, since this image is just running on your own computer, you can feel free to tweak it and customize it to your heart’s content, including changing, removing, or adding desktop environments.

Exiting i3

If you’re not careful, you might accidentally log in using i3, a minimal desktop environment without a typical GUI layout. If you want to get out and switch to a more normal environment, just press Alt+Shift+E and click “Yes, exit i3.”

For security reasons, the virtual machine cannot mount our network drives using our standard method. However, we do have another way to mount network storage. Here’s how you can set it up:

  1. Open a terminal window
    1. In most desktop environments, you can do this by pressing Ctrl+Alt+T (note that since VirtualBox usually uses Right Ctrl as the “host key,” you’ll need to use the left Ctrl key for this)
  2. Choose a location to mount your files in
    1. An easy way to do this is just create a folder in your home folder
    2. To do this, run this command in your home folder (~):
       mkdir [folder_name] 
    3. Replace [folder_name] with whatever you want the folder to be called
  3. Run this command:
     sshfs [username]@schizo.cs.byu.edu: [folder_name] 
    1. Replace [username] and [folder_name] with your CS username and the name of the folder you chose in step 3
    2. If it asks to trust the certificate for the host, tell it “yes”
    3. Type in your CS password
  4. If it’s successful, then your CS network files will show up in the folder you chose in Step 3
  5. If it failed, see if your issue is listed down below:
    1. missing host
      1. Make sure you remembered to type a colon directly after “schizo.cs.byu.edu”
    2. read: connection reset by peer
      1. Make sure you spelled “schizo.cs.byu.edu” and your username/password correctly
    3. fuse: bad mount point
      1. The folder you specified as the mount point does not exist, create the folder and try the command again (see Step 2)
    4. Other issues
      1. If your issue isn’t listed above or the listed steps don’t work, there may be an issue with your account or our network. Contact us at support.cs.byu.edu

VirtualBox has the ability to share files between the host and guest computer. To set this up, follow these steps:

Share folder from host (first time only)

  1. Open Shared Folders settings
    1. If the VM is running: Devices menu > Shared Folders
    2. If the VM is not running: Settings button > Shared Folders
  2. On the right, click the blue folder with a green plus sign
  3. Select the location of the folder you would like to share from your host computer
    1. You can type the location in the box, or click the down-arrow, select “Other…,” and locate the folder
  4. Type a name for the folder to be shared as and make a note of this name
    1. This name can be as generic as you’d like (perhaps just “share”)
  5. Select the settings you want
    1. Make permanent will make it so that the folder is available every time you start up the VM
    2. Auto-mount may or may not work, but it’s beyond the scope of what we’ve tested
  6. Click OK out of the windows you opened
  7. Start your VM and choose a location to mount your files in
    1. An easy way to do this is just create a folder in your home folder
    2. To do this, run this command in your home folder (~):
       mkdir [folder_name] 
    3. Replace [folder_name] with whatever you want the folder to be called

Mount folder in guest (every time you start the VM)

  1. Open a terminal window
    1. In most desktop environments, you can do this by pressing Ctrl+Alt+T (note that since VirtualBox usually uses Right Ctrl as the host key, you’ll need to use the left Ctrl key for this)
  2. Run this command:
     sudo mount -t vboxsf [share_name] [folder_name] -o uid=student,gid=student 
    1. Replace [share_name] with the name you chose in Step 4 of the previous section and [folder_name] with the folder you chose in Step 2
    2. If it asks for your sudo password, type in your VM password (by default this is just “student”)
  3. If it’s successful, then your shared files will show up in the folder you chose in Step 2
  4. If it failed, make sure you typed the correct folder names in the command
    1. It could also be missing the VirtualBox additions packages. Try running this command:
       sudo apt install virtualbox-ose-guest-utils virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms 

You can reference our Linux documentation page for assistance using Linux. The BYU Linux Club is also a helpful resource. If you have a specific issue that you need help with, your best bet is to search it online. There is a thriving community of Linux users on various online forums. We’ll update this section as we find common tasks or problems that you may need help with.

  • linux-virtual-machine-image.txt
  • Last modified: 2020/08/25 09:22
  • by wr1ght96