VirtualBox Virtual Machine Creation: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 175: Line 175:
==Linux Guest OS Installation==
==Linux Guest OS Installation==


Select the VM -> Settings -> Storage -> Controller: IDE -> Select drive -> Attributes: Optical Drive: IDE Secondary Master -> click on the Disk icon on the right -> Choose Virtual Disk File -> Select the OS iso file.
Select the VM -> Settings -> Storage -> Controller: IDE -> Select drive -> Attributes: Optical Drive: IDE Secondary Master -> click on the Disk icon on the right -> Choose Virtual Disk File -> Select the OS iso file -> OK.


Start -> Normal Start
Select the VM -> Right click -> Start -> Normal Start.


From now on go to [RHEL7] to perform the guest OS installation and then return here to continue with Guest Additions.
The Linux installation program should start. From now on go to [RHEL7] to perform the guest OS installation and then return here to continue with Guest Additions.


!!!Guest Additions
!!!Guest Additions

Revision as of 01:07, 8 January 2016

Internal

Linux

VM Creation

From the VirtualBox Manager -> New -> Expert Mode (it may already start in Expert Mode, and in that case, you'll see a button named "Guided Mode" at the bottom of the screen).

The VM creation process with create the corresponding files in a directory associated with the VM, in ~/VirtualBox VMs/<vm-name>.

The VID (VirtualBox disk image) is a file with .vdi extension.

Name master31-1.openshift.local

Type Linux

Version Red Hat (64-bit)

Memory Size Choose as appropriate. Always keep in mind the amount of physical memory available to your hypervisor, and how many VMs you plan to use at the same time.

Create a virtual hard disk now

Create

File Location Will default to the VM name and that is appropriate. The corresponding physical file will get a .vdi extension and it will be available as ~/VirtualBox VMs/<vm-name>/<vm-name>.vdi

File size A typical minimal RHEL 7.2 takes about 1.6GB.

Hard disk file type VDI (VirtualBox Disk Image)

Storage on physical hard disk Dynamically allocated

Create

After this step, the VM should be created and you can review configuration in the right pane.

If you plan to manage this VM as part of a group, now is the time to create the VirtualBox group and move the VM in it.

Virtual Hardware Configuration

Note

Click OK often, if you go through many changes and successive tabs and don't click OK, Cancel will discard all changes.

Select the newly created VM -> Right click -> Settings

System

System -> Motherboard

Boot Order Optical, Hard Disk (deselect Floppy)

Chipset ICH9

Pointing Device USB Tablet (this is important, default "PS/2 Mouse" does not handle well cursor transition between windows and you will need to Left Command to release the mouse.

Extended Features

  • Enable I/O APIC
  • Hardware Clock in UTC Time

System -> Processor

Processors(s)

Execution Cap 100%

Extended Features Enable PAE/NX

System -> Acceleration

Paravirtualization Interface Default

Hardware Virtualization

  • Enable VT-x/AMD-v
  • Enable Nested Paging.

Display

Display -> Screen

Video Memory 128 MB

Monitor Count 1

Scale Factor 100%

HiDPI Support Use Unscaled HiDPI Output

Display -> Remote Display

Display -> Video Capture

Storage

Settings -> Storage

Controller IDE

Attributes

Name IDE

Type ICH6

Use Host I/O Cache

Empty -> Leave it IDE Secondary Master.

No Live CD/DVD

Controller SATA

Attributes

Name SATA

Type AHCI

Port Count 1

Use Host I/O Cache

<vm-name>.vdi

Attributes

Hard Disk SATA Port 0

Solid-state Drive (if it's a Solid-state Drive)

Network

See VirtualBox Networking Concepts for clarifications. Usually we we want to add one Host-only adapter and one NAT adapter (in this order).

Before adding the Host-only network adapter, go to VirtualBox -> Preferences -> Network -> Host-only Networks and add a Host-only network, if required. If one already exists and you plan to share it, you're all set. If there isn't any, add "vboxnet0". Configure it as described here: VirtualBox Host-Only Networking Configuration.

Settings -> Network

Edit "Adapter1" and "Adapter2". Adapter1 should be Host-only and Adapter2 should be NAT. For all adapters:

Enable Network Adapter

Attached to: Host-only Adapter, then NAT

Advanced

Adapter Type Paravirtualized Network (virtio-net)

Promiscuous Mode Deny

MAC Address use default

Cable Connected yes

Save the Hardware Configuration

At this point, the virtualized hardware configuration is defined, save it.

Clone VMs with Identical Hardware

If we are going to create more virtual machines with the same hardware configuration, now is the moment to clone them.

Right click on the newly created VM -> Clone

Give it the appropriate name.

Clone Type: Full Clone

Snapshots: Current machine state

Reinitialize the MAC address of all network cards

Linux Guest OS Installation

Select the VM -> Settings -> Storage -> Controller: IDE -> Select drive -> Attributes: Optical Drive: IDE Secondary Master -> click on the Disk icon on the right -> Choose Virtual Disk File -> Select the OS iso file -> OK.

Select the VM -> Right click -> Start -> Normal Start.

The Linux installation program should start. From now on go to [RHEL7] to perform the guest OS installation and then return here to continue with Guest Additions.

!!!Guest Additions

The guest additions are special software packages that are shipped with VirtualBox but designed to be installed inside a VM to improve the performance of the guest OS and add extra features.

Guest Additions are supposed to be installed inside the virtual machine after the guest operating system has been installed:

[1]

Download Template:VBoxGuestAdditions 5.0.4.iso from the same place, then mount the image as a local filesystem: Select the VM -> Settings -> Storage -> Controller IDE -> Disk icon -> Choose Virtual Optical Disk File

Then I found the content under: /dev/disk/by-label/VBOXADDITIONS_5.0.4_102546

Then I mounted it

{{{ mount /dev/disk/by-label/VBOXADDITIONS_5.0.4_102546 /mnt }}}


Installation as root:

{{{

yum update yum install bzip2 kernel-devel gcc

cd /mnt ./VBoxLinuxAdditions.run }}}


!!!Reboot to Make Sure the Host Starts


!!!Still TODO

Set shared folders and write down the procedure. Manual page 70.


!!!Windows VM Creation

Lessons learned so far:

  • The screen resolution does not seem great and the mouse interaction is choppy.
  • It is probably best if I access it over Remote Desktop
  • Some way to exchange files/


__Referenced by:__\\ [{INSERT com.ecyrd.jspwiki.plugin.ReferringPagesPlugin WHERE max=20, maxwidth=50}]