How To Setup Virtual Box-v4 PDF

Title How To Setup Virtual Box-v4
Author reshub shrestha
Course Ba Major Project
Institution Federation University Australia
Pages 10
File Size 559.7 KB
File Type PDF
Total Downloads 115
Total Views 149

Summary

Download How To Setup Virtual Box-v4 PDF


Description

How to setup VirtualBox on a Windows machine

(LinuxLite version – Dec 2017)

The course ITECH1102 Networking & Security uses VirtualBox to run LinuxLite as a virtual machine under Windows. The FedUni Windows lab machines have an image of LinuxLite installed on them. ITECH1102 students are encouraged to setup VirtualBox and the LinuxLite image onto their own Windows hardware. This allows students to repeat some lab exercises outside normal scheduled lab times and to experiment with LinuxLite. This document outlines how to setup VirtualBox on a Windows platform in a similar way to how it is setup on university lab machines. The following 4 steps summarises the installation process: Step 1

- Run the Image setup installer to copy files to C:\VBoxImages\

Step 2

- Install VirtualBox onto your machine

Step 3

- Configure two batch files to reflect your machine’s hardware

Step 4

- Test that everything works

Getting a copy of the required installation files Students wanting to setup VirtualBox on their own hardware will need a USB stick with 2GByte free to hold the required installation files. How to get the installation files:  Day students at Mt Helen, Gippsland, Berwick or Partners can copy the folder C:\VBoxImages\USB\ from one of the lab machines used for ITECH1102 lab classes to their own USB stick or USB hard drive.  Online students (or any ITECH1102 student) can download from here a zip file named FedUni_Image_Setup.zip that contains all required installation files.  The IT Help Desk at some Partner institutions may also have populated USB sticks for loan that contain the required installation files. The folder C:\VBoxImages\USB\ of a lab machine or an unzipped version of FedUni_Image_Setup.zip should yield the following set of files.

Once you have a copy of the above files on a USB device you are ready to run the installer that copies the required files to a folder on your Windows machine. Note - VirtualBox runs best on machines with 4GBytes or more of RAM.

Step 1 - Copy all required files to your Windows machine Run the file installer named FedUni_Image_Setup_USB.exe on your Windows machine. The installer creates a folder C:\VBoxImages\ and copies all required files into it. The installer also creates the folder C:\VBoxImages\USB\ and populates it with all installation files. Hence you have access to the installation files if required. The installer’s opening screen is shown below:

The next screen of the file installer allows you to choose the components you want to install. Installing all components will be required in most cases.

The file copy process will take around 5 minutes to complete depending on the speed of your machine. Note – We will not require the VirtualBox shortcuts and so during the VirtualBox installation make sure you uncheck the option to install the StartMenu and Quick Launch Shortcuts

After the file copy is complete a folder named C:\VBoxImages\ will have been created and should contain the following files:

The .vdi (virtual disk image) is the file that contains LinuxLite. The file vb.bat is used to automatically launch VirtualBox and configure the virtual machine in the VirtualBox interface. During this process vb.bat calls createvm.bat. The file RefreshImages.bat is used to revert the virtual disk image back to its installation state. (Note - VirtualBox must be shut down prior to running the RefreshImages.bat batch file.)

Step 2 – Install VirtualBox If you checked the option to Install VirtualBox it should have been installed onto your Windows Operating System. If not you should install VirtualBox. Note – It is best if you accept all defaults except those related to creating shortcuts. The shortcuts we will be using should have already been created in the Start Menu by the file installer, therefore we do not need any of the normal shortcuts created by the VirtualBox installation program and as such you should uncheck the option to install them during the VirtualBox installation.

Step 3 : Configure two batch files to reflect your machine’s hardware The batch files named C:\VBoxImages\vb.bat and contain entries that refer to your specific hardware.

C:\VBoxImages\createvm.bat

vb.bat The vb.bat file has an entry on line 15 that refers to the drive letter that your hardware uses to access a USB memory stick. The default value in the vb.bat file is e: as shown below. rem Set the drive where a USB stick will be accessed in the host set usbdrive=e: If your hardware accesses the USB stick on a different drive letter then you should edit the vb.bat file (change e: to the correct drive letter for your system). To edit the vb.bat file right click the file, select edit. Make the change then save it. (On some machines you may need to edit the file with administrative privilege)

createvm.bat If your operating system is Windows 10 or later, your network interface card should be detected and the virtual machine created without issue. If you are running an earlier version of Windows (7 or 8.1 for example), you will need to specify the exact name of the network interface card in your machine in this batch file. It is the 19th line in createvm.bat, and the line in question is shown below: if %vi% geq 10 (FOR /F "tokens=2 delims==" %%a in ('WMIC nic where ^(netconnectionid^='Ethernet'^) get name /format:list') do SET ADAPTERNAME=%%a) else (SET ADAPTERNAME="----Enter the exact name of your NIC between these quotes if you are not using Windows 10 or later----")

You need to find the name of your Network card, copy the name and paste it between the quotes of the 19th line of the createvm.bat batch file. You can specify the name of your wired network card if you want your virtual machines to use a wired connection for all their networking tasks, or you can specify the name of your WiFi card if all networking is to be done wirelessly. (This is the most common choice) For instance the WiFi card on my notebook is named Broadcom 802.11n Network Adapter So line 19th of my createvm.bat file should be as follows. if %vi% geq 10 (FOR /F "tokens=2 delims==" %%a in ('WMIC nic where ^(netconnectionid^='Ethernet'^) get name /format:list') do SET ADAPTERNAME=%%a) else (SET ADAPTERNAME="Broadcom 802.11n Network Adapter") Note – There should be no space between the quotes and the Network Card’s name.

Once these changes have been made everything should work.

Finding the name of your Network Card Determining the exact name of your network card can be a little challenging. Method 1 Open Control Panel > Network & Sharing Center >

Change adapter settings >

Select the interface you want to use (WiFi or Wired) > Properties Now copy the name and then paste it into the createvm.bat file.

Method 2: Open a command prompt Enter the command ipconfig /all

Find the name of the WiFi interface (or wired if you prefer). To copy the name > right click on the name > mark > select the name > press enter Then use ctrl v to paste the name into the createvm.bat file Note – When pasting the name into the createvm.bat file please ensure there are no spaces or other characters between the opening or closing quotation marks and the network card’s name, otherwise networking will not work on your LinuxLite machine.

Step 4 : Test that everything works Run the batch files The two batch files C:\VBoxImages\vb.bat and C:\VBoxImages\RefreshImages.bat are all you require to start VirtualBox and Refresh the Operating System image. It is good practice to run the RefreshImages.bat batch file prior to lab classes or home study sessions to ensure you are working on clean images. One way to do this is double click C:\VBoxImages\RefreshImages.bat. To invoke the populated VirtualBox interface (shown on the next page) simple double Click C:\VBoxImages\vb.bat Alternatively you could create shortcuts to these two batch files and place them on your desktop. Or you could use the shortcuts the installation program has probably placed in the Start Menu. (described below).

Start Menu shortcuts The following diagram shows the shortcuts you should see in the Start Menu under Oracle VM VirtualBox

We will only need to use the first two shortcuts. The “FedUni – Run VirtualBox” shortcut initializes the two virtual machines and runs VirtualBox. The shortcut “Oracle VM VirtualBox” should not be used. Try clicking on the shortcut. If everything is OK you will see the VirtualBox opening screen as shown below.

Things to Note:  The left hand pane lists the virtual machine we will be using in ITECH1102.  The right hand pane details the settings for the selected VirtualMachine, in this case ITECH1102-LinuxLite.  Under General we can see the name of the Virtual machine and the operating system type.  Under System we can see the amount of memory allocated to the LinuxLite virtual machine (450Mbytes) and other settings.  Under Storage you can see the name of the file used as the virtual machines hard drive (LinuxLite.vdi), it also tells us it is of type immutable (Read Only).  Under Network you will see the name of the network card.  Under USB we see it is disabled (This is OK because we used shared folders to share a USB stick between the host operating system and the virtual operating system)

Running a Virtual machine To run the Virtual Machine select it in the left pane, and then click the Start icon. Ignore any warnings (click the blue crosses) You should see the LinuxLite opening screen display (as shown below).

Note – The user1 password for LinuxLite is user1pw. After you login to LinuxLite you can start playing with the LinuxLite GUI or you can open a terminal screen to start using Linux command line commands. The icon to open a LinuxLite terminal (console) is the small black icon at the bottom of the LinuxLite interface. If you click the icon you will get a Linux console. We will be using this a lot throughout ITECH1102.

Refreshing the images We will regularly want to refresh the LinuxLite image back to its installation state to retry lab exercises. To refresh the image: 1. Close down VirtualBox (very important first step) 2. Wait a short while (10 seconds) for all VirtualBox processes to close 3. Run the Start Menu Shortcut “Fed Uni – Refresh Images” Note – This will not work if VirtualBox or any of the VirtualBox processes are running. Sometimes you may even need to open Task Manager to shutdown VirtualBox processes that refuse to close down in an orderly manner, or reboot your Windows machine.

Bypassing the Start Menu shortcuts The two Windows Start Menu shortcuts are responsible for running the batch files C:\VBoxImages\vb.bat and C:\VBoxImages\RefreshImages.bat I often find it easier to open Windows Explorer to C:\VBoxImages\ and double click RefreshImages.bat to reset the images to a clean state or vb.bat to display the VirtualBox opening screen. Either method is fine.

Troubleshooting Enabling Virtualization Technology in your computers BIOS. Virtualization technologies like VirtualBox often require Virtualization Technology (VT-x or AMD-V ) to be enabled in your computers BIOS. Enabling Virtualization in the BIOS differs from machine to machine. If you are having problems with this get assistance from staff of fellow students. You may need to refer to your computers documentation or the Internet to determine how to access the BIOS on your computer and how to change this BIOS setting. Note Some computers enter the BIOS if you press F1, or F2, or F3 or ESC or Delete early in the boot process. Deleting unwanted directories. If you happened to run VirtualBox during its installation, unwanted directories may have been created in your Windows profile directory. These need to be deleted. To do so Open Windows Explorer to: C:\Users\Username\ Now delete the folders named:  .VirtualBox  VirtualBox VMs Versions of VirtualBox Sometimes a particular version of VirtualBox will not run on a particular version of Windows. The version we are currently using runs fine with current Windows 10 installations and will probably work with previous versions of Windows.

Setting up VirtualBox on your own hardware is optional for day students. Day students should realise that installing VirtualBox on your own hardware is optional. All day students at Mt Helen, Gippsland and partners should attend all ITECH1102 lab classes and complete lab tasks within the lab classes. However installing VirtualBox and the associated virtual images gives day students the ability to also practice lab tasks outside normal lab sessions. On-line students should setup VirtualBox onto their own hardware so they have full administrative access to LinuxLite and Windows 8.1 and are hence in a position to complete all lab tasks as required in the course. On-line students will be sent an installation USB stick early in the semester.

Installing LinuxLite under VirtualBox on a Mac Students wanting to run LinuxLite on a Mac should refer to the Resources section of the ITECH1102 Moodle site for guidelines.

Note to partner institution technical staff: Partner institutions may create working versions of the three batch files on their Installation USB stick and name them with the prefix Partner- as shown below. When the file installer is run the Partner- versions of the batch files will be copied to C:\VBoxImages instead of the generic student versions. This will allow partner institutions to use a single USB installation stick to install multiple identical lab machines with the one USB set of files without the need to update batch files on individual machines....


Similar Free PDFs