Starting up Virtual Machine
What is a Virtual Machine
Virtual Machine (VM) is an emulation of a particular computer operating system. Users have the same experience on a virtual machine as they would have on a particular computer operating system. Virtual machine share the resources on the main operating system. It emulates the PC client or server's CPU, memory, hard disk, network and other hardware resources completely to create a new operating environment within. Virtual machine can emulate multiple virtual hardware platforms that are isolated from each other. This allows user to save costs by reducing the need of multiple hardware systems. Find more information about Virtual machine HERE
Virtual Machine Programs
Oracle VirtualBox is very popular virtual machine because it is open-source and completely free. It has multiple features that make running and maintaining virtual machine easily.
VMWare is another popular virtual machine program. VMWare Player and VMWare Workstation are the two primary versions. VMWare Player is similar to VirtualBox. It is free and easy to create virtual machine that do not need enterprise-level solution. On the other side, WMware Workstation provides all the features of VMWare Player includes the ability to clones machines, take multiple snapshots of the guest OS, and replay changes made to the guest OS software testing.
Installation of Ubuntu Operating System Environment
Ubuntu is a Debian-based Linux operating system and distribution. It is a free and open-source operating system. HIO project supports Ubuntu 12.10 and Ubuntu 14.04.2 LTS. The Long Term Support (LTS) version of the Ubuntu operating system comes with five year of security and maintenance update. Find more information about Ubuntu and Linux HERE
|CPU||2 Core Processors|
Before installation, there are some requirements for the virtual machine. In virtual machine, the OS and Data are grouped together. Compilation of Yocto project required multiple dependency, having more than 1 core processor will dramatically increase the run time. In addiction, the size of the data that required to create an image is approximately 30 G. Prepared the virtual machine to have at least 80 G will increase the load time. Same as memory, the more memory, the faster it can run. Because virtual machine is using the same physical hardware of the host computer, it is not recommended to set up the virtual machine to have the same capacity of the host computer. Maximizing the capacity will largely impact the host computer, effect in hanging to shutting down.
After we have a clear understanding of the host computer specification. We can now set up the virtual machine:
- Start virtual machine to install Ubuntu.
- Create a New Virtual Machine
- Select Typical Installation (Recommended)
- Choose installation from IOS image, then locate the Ubuntu IOS by clicking Browse
- Personalize (The password created will be used to login)
- Name the Virtual Machine and Saving Location
- Specify Disk Capacity: Recommended Disk Size 80G
- Ready to Create Virtual Machine -> Click Customize Hardware...
- Memory: At least 2G
- Processor: At least 2 Core, 1 Thread for each core
- Click Finish
Mounting Removable Devices
The removable device which that is attached to the host computer will not appear in the virtual machine. To connect the removable devices (eg. flash drive, SD card, external hard drive). For VMWare Station
- Click VM on top bar
- Hover to Removable Devices -> Alcor Micro Mass Storage Device -> Connect
Input the following command into the terminal
This command will show the name of drive, the size, type, and where it is mounted to.
In this example, sda and sdc are the name and they are partition into multiple parts. sda1 is mounted into the root folder. sdc1 and sdc2 are not mounted yet.
Mounting the Drive
New Drive needs to be formatted first before using. Only need to do it once.
Skip Step 1 if the drive has been formatted.
Note: Format the device will erase the whole content of the drive.
1. To format, input the following command, replace <name of the drive> with the name of the newly created drive.
$sudo mkfs.ext4 /dev/<name of the drive>
2. A directory needs to be created to attach the drive. Eg. we will create a directory calls /data in the root folder.
$sudo mkdir /data
Mount the drive into /data directory
$sudo mount /dev/<name of the drive> /data
check the mounted device
Unmount the drive
to Unmount the follow from /data directory, input the following command
$sudo umount /dev/<name of the drive> /data
Note: Before detaching from the host computer, it is recommended to unmount the drive from the virtual machine first to prevent lose of data.