Virtual Machine (VM)

IT provision for the unit is based on the assumption you work in the lab. using UoB-managed and thus supported equipment. If you need or prefer to use your own equipment, however, unsupported alternatives include the use of a bespoke VM which aims to replicate a lab. workstation as closely as possible:

  • Read over some sort of tutorial material if need be.

  • Install various pre-requisites, i.e.,

    • VirtualBox including any extension packs necessary, e.g., for USB device support, and
    • Vagrant, plus associated plug-ins, as need be, e.g., by executing

      vagrant plugin install vagrant-vbguest
      vagrant plugin install vagrant-disksize
      vagrant plugin install vagrant-reload
      

    Note that:

    • using a recent version of VirtualBox is strongly recommended: currently this is 6.x, whereas you may get 5.x when using some package managers,
    • when using a Windows-based host, you may also need to install an X server (e.g., Xming) in order to support forwarded X11 client interfaces, and
    • some features of the VM (e.g., access to USB devices) may demand you are a member of the vboxusers; group; you can ensure this by executing

      sudo usermod --append --groups vboxusers ${USER}
      
  • Launch the VM using either of the following approaches:

    1. Self-provisioned:

      • execute

        mkdir ./COMS10015
        cd ./COMS10015
        wget --quiet https://assets.phoo.org/COMS10015_2024_TB-4/csdsp/vm/vm.tar.gz
        tar --gzip --extract --file='vm.tar.gz'
        cd ./vm
        

        to download a Vagrantfile that references an un-provisioned base box,

      • edit the resulting Vagrantfile to suit any specific requirements,

      • execute

        vagrant up
        

        after which the VM boots, and the provisioning step executes: this may take some time.

    2. Pre-provisioned:

      • execute

        mkdir ./COMS10015
        cd ./COMS10015
        mkdir ./vm
        cd ./vm
        vagrant init danpage/COMS10015
        

        to generate a Vagrantfile that references a pre-provisioned base box,

      • edit the resulting Vagrantfile to suit any specific requirements,

      • execute

        vagrant up
        

        after which the VM boots: this may take some time.

  • Access the VM:

    • check the SSH configuration matches what you expect by executing

      vagrant ssh-config
      
    • automatically use SSH to access the VM, e.g., by executing

      vagrant ssh
      
    • manually use SSH to access the VM, e.g., by executing

      ssh vagrant@localhost -p 2222 -i .vagrant/machines/default/virtualbox/private_key -X
      

      where -p specifies a port (on localhost) matching the SSH configuration, -i specifies an identity whereby the private key for vagrant is used, and -X enables X11 forwarding, i.e., display of GUI applications on the host desktop.

    Note that /home/vagrant/share represents a shared folder accessible from both the host and guest VM. We recommend using this for transfer of data only, however, rather than as a “live”, working file system: it seems the VirtualBox implementation of this feature is imperfect, meaning that the latter can result in somewhat cryptic errors which are difficult to resolve.