51
VirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to www.virtualbox.org and select Downloads. Download the current release* of VirtualBox for the OS on which you will install VirtualBox. In these notes, that's Windows 7. Note: - the OS on which you will install VirtualBox is called the host OS. - the OS you will install on VirtualBox (later) is called the guest OS. In these notes, I have a Windows 7 host and a CentOS guest. Also, download the corresponding release of the VirtualBox Extension Pack. * These notes are based on VirtualBox 5.0.20 and CentOS 7.

Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

1

CS@VT ©2013-2016 McQuain

Get VirtualBox

Go to www.virtualbox.org and select Downloads.

Download the current release* of VirtualBox for the OS on which you will install

VirtualBox. In these notes, that's Windows 7.

Note:

- the OS on which you will install VirtualBox is called the host OS.

- the OS you will install on VirtualBox (later) is called the guest OS.

In these notes, I have a Windows 7 host and a CentOS guest.

Also, download the corresponding release of the VirtualBox Extension Pack.

* These notes are based on

VirtualBox 5.0.20 and CentOS 7.

Page 2: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

2

CS@VT ©2013-2016 McQuain

Begin the VirtualBox Installation

Run the VirtualBox installer. The first few screens are typical and probably do not

require you to make any changes to the default options:

Page 3: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

3

CS@VT ©2013-2016 McQuain

Begin the VirtualBox Installation

You may be prompted about installing various components relating to USB support

and networking:

My advice is to just select "Always trust…" and let it go…

Page 4: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

4

CS@VT ©2013-2016 McQuain

Begin the VirtualBox Configuration

Once the base installation is complete, VirtualBox will start:

Choose File/Check for Updates… if

there's a newer release of

VirtualBox, you might want to update

to it at this point...

Page 5: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

5

CS@VT ©2013-2016 McQuain

Install the VirtualBox Extensions

Select File/Preferences, go to Extensions, click the select buttton, find the

VirtualBox Extensions file you downloaded earlier.

Select Upgrade and let the installation proceed...

Page 6: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

6

CS@VT ©2013-2016 McQuain

Starting VirtualBox

When the installation completes, you can run VirtualBox for the first time:

You may see

something like this,

or not…

Page 7: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

7

CS@VT ©2013-2016 McQuain

Creating a Virtual Machine

Give the new VM a descriptive

name.

If you use a descriptive name for

the VM, VirtualBox should auto-

detect the proper OS type and

version:

Page 8: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

8

CS@VT ©2013-2016 McQuain

Troubleshooting...

If you do not see any choices for a 64-bit guest OS (see dialog below):

• shut down VirtualBox and reboot your computer

• go into your BIOS setup (how? that depends on your system)

• find an entry for "Intel Virtualization Support" or "Intel VT-X" or "AMD-v" (or

something like that) and make sure it's enabled

Page 9: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

9

CS@VT ©2013-2016 McQuain

Troubleshooting...

If that did not work (you still see only 32-bit choices)...

If yes, check out the following sites (especially if you are running Windows 8 or 10):

forums.virtualbox.org/viewtopic.php?f=1&t=62339

forums.virtualbox.org/viewtopic.php?f=6&t=74794

superuser.com/questions/866962/why-does-virtualbox-only-have-32-bit-option-no-64-bit-option-on-windows-7

www.fixedbyvonnie.com/2014/11/virtualbox-showing-32-bit-guest-versions-64-bit-host-os/#.V0I3EGfmozw

Page 10: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

10

CS@VT ©2013-2016 McQuain

Configuring Memory for the VM

Specify the amount of memory you'll give the VM.

In this example, I'm installing on a host machine with 32GB of RAM; with 8GB, I'd

probably have given the VM 4GB.

Page 11: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

11

CS@VT ©2013-2016 McQuain

Configuring a Virtual Hard Disk

In the next dialog, select the option to create a new virtual hard drive now.

Take the default hard drive file type in the next dialog unless you're concerned

about being compatible with some other virtualization tool like VMWare.

Next, I recommend choosing a fixed-size hard disk.

Page 12: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

12

CS@VT ©2013-2016 McQuain

Configuring a Virtual Hard Disk

I generally make this 32GB, but make it smaller if you're short on space.

Page 13: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

13

CS@VT ©2013-2016 McQuain

An Empty VM

Now, you have an empty virtual machine; that is, a formatted (virtual) hard disk

and no OS.

Page 14: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

14

CS@VT ©2013-2016 McQuain

VM Settings

There are a couple of crucial VM settings; right-click on your VM and bring up the

Settings dialog:

Under General/Advanced, make

the Shared Clipboard and enable

Drag’n/Drop Bidirectional.

Under Display, enable 3D

Acceleration.

Page 15: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

15

CS@VT ©2013-2016 McQuain

Install CentOS as a Guest OS

CentOS matches the department’s servers, including the rlogin cluster, so that is

what you should install.

You need to select a 64-bit version.

A 64-bit version gives you a few more options, and that's what we're running on

our servers, so I require the 64-bit version.

If you install a 32-bit version, you won't be able to run any 64-bit code on it.

If you install a 64-bit version, you won't be able to build any 32-bit executables on

it unless you install some additional packages.

Download a DVD ISO file for CentOS 7.

Disclaimer: the following notes illustrate one session installing CentOS 7 on

VirtualBox 5.0.20, running on Windows 7 Enterprise, on a particular

underlying hardware system.

YMMV. Mine certainly has…

Page 16: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

16

CS@VT ©2013-2016 McQuain

Preparation

Go to centos.org, use the Get CentOS link at the top of the page, and select the

link for the distribution option you want (I recommend DVD ISO):

Choose a mirror for

downloading; I recommend one

from VT (the current release is

1511):

Page 17: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

17

CS@VT ©2013-2016 McQuain

Beginning the Installation

Select the VM and click Start:

Page 18: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

18

CS@VT ©2013-2016 McQuain

Selecting Installation Media

VirtualBox will recognize the empty system and prompt you to select an

installation disk.

Click the folder icon and select your CentOS ISO file; then click Start...

Page 19: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

19

CS@VT ©2013-2016 McQuain

Running the Installation Code

The following sequence of screen shots are mostly self-explanatory…

Select Install CentOS 7... … and it grinds away awhile…

Page 20: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

20

CS@VT ©2013-2016 McQuain

Running the Installation Code

Some basic settings need to be established:

Language

Installation site

Initial software

configuration

Page 21: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

21

CS@VT ©2013-2016 McQuain

Installation Destination

This will be the virtual harddrive you just created... take the defaults.

Page 22: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

22

CS@VT ©2013-2016 McQuain

Software Selection

Here, I prefer the GNOME desktop and I want to be sure that I install the

development tools (compiler, etc).

Make other choices as you like... more packages can be installed later.

Page 23: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

23

CS@VT ©2013-2016 McQuain

Continue Installation

Fire up the installation routine...

Page 24: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

24

CS@VT ©2013-2016 McQuain

root and User Account Setup

root is the administrative account.

You will use that for most software installs and some other activities.

Do not forget this password!

I also set up a user account

for my personal use.

While the installation is running, set the

password for the root (superuser) account.

Page 25: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

25

CS@VT ©2013-2016 McQuain

Other Settings

Eventually you should see the completion screen (it takes awhile, depending on

how many software packages you chose, the speed of your machine, etc).

Now, you need to restart the

virtual machine...

Page 26: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

26

CS@VT ©2013-2016 McQuain

Login Screen

The restart will bring you to the login screen:

Page 27: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

27

CS@VT ©2013-2016 McQuain

Initial Options

CentOS starts with some basic language and keyboard configuration:

Page 28: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

28

CS@VT ©2013-2016 McQuain

GNOME Help

On first startup, you'll be offered help for the Linux environment:

Ignore this or explore it, as you like...

Page 29: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

29

CS@VT ©2013-2016 McQuain

Starting the Network

Click the Network icon and turn on the network... the default settings are usually

OK.

Page 30: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

30

CS@VT ©2013-2016 McQuain

Software Updates

I recommend running a general software update at this point.

Go to the Application/?? menu and pick software update...

Page 31: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

31

CS@VT ©2013-2016 McQuain

Software Updates

I'd just install ALL of them at this point... it will take awhile...

Page 32: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

32

CS@VT ©2013-2016 McQuain

Authorizing Updates

Now, you DO remember the root password you set earlier... right?

Page 33: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

33

CS@VT ©2013-2016 McQuain

First Completion…

Things should proceed automatically until a restart is needed.

To restart or shutdown, go to the user menu and select Power Off…

Page 34: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

34

CS@VT ©2013-2016 McQuain

VirtualBox Guest Additions

The VirtualBox Guest Additions provide additional functionality for your VM.

Another note: if you run the system updater or install other software on your VM,

you may have to reinstall the Guest Additions.

One note: until you install the VirtualBox Extension Pack (slide 5) and the Guest

Additions, some things like mouse capture and scaled displays may not work.

Page 35: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

35

CS@VT ©2013-2016 McQuain

VirtualBox Guest Additions

The CD image is included in the VirtualBox installation package.

You must mount the CD image:

CentOS should recognize the installer once the image is mounted:

Page 36: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

36

CS@VT ©2013-2016 McQuain

VirtualBox Guest Additions

Pay attention to the console window during the installation.

If there are error messages, the Guest Addition may not have been installed

properly.

Page 37: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

37

CS@VT ©2013-2016 McQuain

Additional Stuff: yum

As you use your CentOS system, you'll probably discover new tools you'd like

that are not included by default.

In most cases, if you know the name of the software package you'd like to install, you can do so by running the yum tool. yum has many options and you should

skim its man page.

For instance, we can use yum to determine what version of a package is installed:

wdm@Centos65 ~]$ yum list installed gcc

Loaded plugins: fastestmirror, refresh-packagekit, security

Determining fastest mirrors

* base: mirror.trouble-free.net

* extras: mirrors.einstein.yu.edu

* updates: mirrors.advancedhosters.com

base | 3.7 kB 00:00

extras | 3.4 kB 00:00

updates | 3.4 kB 00:00

Installed Packages

gcc.x86_64 4.4.7-4.el6 @anaconda-CentOS-201311272149.x86_64/6.5

[wdm@Centos65 ~]$

Page 38: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

38

CS@VT ©2013-2016 McQuain

Additional Stuff: yum

We can use yum to install or update a package:

[wdm@Centos65 ~]$ yum install tree

. . .

You need to be root to perform this command.

[wdm@Centos65 ~]$ su

Password:

[root@Centos65 wdm]# yum install tree

. . .

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package tree.x86_64 0:1.5.3-2.el6 will be installed

--> Finished Dependency Resolution

. . .

Transaction Summary

===============================================================

Install 1 Package(s)

Total download size: 36 k

Installed size: 65 k

Is this ok [y/N]: y

. . .

You need to be root to install or

update a package:

Now I am root ...

bwa ha ha!

yum has determined what

needs to be installed,

shown me that info, and

now wants confirmation...

Page 39: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

39

CS@VT ©2013-2016 McQuain

Additional Stuff: yum

We can use yum to install or update a package:

. . .

Downloading Packages:

tree-1.5.3-2.el6.x86_64.rpm

| 36 kB 00:00

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : tree-1.5.3-2.el6.x86_64

1/1

Verifying : tree-1.5.3-2.el6.x86_64

1/1

Installed:

tree.x86_64 0:1.5.3-2.el6

Complete!

[root@Centos65 wdm]# exit

exit

[wdm@Centos65 ~]$

yum triggers the installation..

Now I will cease to be root ...

that much privilege can be

dangerous.

Page 40: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

40

CS@VT ©2013-2016 McQuain

Enabling 32-bit Builds

If you need to create 32-bit executables on your 64-bit CentOS VM, you'll need to

install some additional packages:

yum install glibc-devel.i686

yum install libgcc.i686

Page 41: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

41

CS@VT ©2013-2016 McQuain

Additional Stuff: yum

Sometimes yum cannot find a package:

[root@Centos65 wdm]# yum install geany

Loaded plugins: fastestmirror, refresh-packagekit, security

. . .

No package geany available.

Error: Nothing to do

[root@VMCentOS64 wdm]# yum queries a collection of online

repositories... in this case it doesn't

find the package I wanted.

It's possible to direct yum to search additional repositories. See a good Linux

reference or the man pages for more information.

Page 42: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

42

CS@VT ©2013-2016 McQuain

Adding a Repository

[wdm@localhost ~]$ su

Password:

[root@localhost wdm]# yum install epel-release

...

====================================================================

Package Arch Version

Repository Size

====================================================================

Installing:

epel-release noarch 7-5

extras 14 k

Transaction Summary

====================================================================

Install 1 Package

Total download size: 14 k

Installed size: 24 k

Is this ok [y/d/N]: y

Here, I'm adding another common repository to those yum queries.

Page 43: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

43

CS@VT ©2013-2016 McQuain

[root@localhost wdm]# yum install geany

...

Dependencies Resolved

======================================================================

Package Arch Version Repository Size

======================================================================

Installing:

geany x86_64 1.24.1-1.el7 epel 3.6 M

Installing for dependencies:

vte x86_64 0.28.2-10.el7 epel 361 k

Transaction Summary

======================================================================

Install 1 Package (+1 Dependent package)

Total download size: 3.9 M

Installed size: 15 M

Is this ok [y/d/N]: y

...

Here, I'm installing a

programmer's editor, geany.

Installing Geany

Page 44: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

44

CS@VT ©2013-2016 McQuain

Additional Stuff: Geany

geany is a programmer-oriented editor:

It's my (current) favorite text editor for programming on Linux.

It's also available for Windows.

Page 45: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

45

CS@VT ©2013-2016 McQuain

Additional Stuff: KDE Desktop

If CentOS 7 runs very slowly on your VM, you may find that performance is vastly

enhanced if you switch from the GNOME desktop environment to KDE.

As root, issue the following command:

yum groupinstall "KDE Plasma Workspaces"

The installation takes awhile, but I found CentOS 7 ran much faster.

When you log in, you can click on the gear

icon to get a drop list of choices for your

desktop.

Page 46: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

46

CS@VT ©2013-2016 McQuain

Shared Folders

The most efficient way to transfer files between your VM and the host OS is to set

up a shared folder that both OSes can see.

Pick the folder you want to share; I'll use E:\share on my Win7 host.

In the VirtualBox Manager, click on Shared Folders and select the Add Folder

button, then enter the path to the shared folder and make it permanent:

Page 47: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

47

CS@VT ©2013-2016 McQuain

Shared Folders

Then, in CentOS become root and execute the commands:

mkdir /media/windows-share

mount.vboxsf share /media/windows-share

The first command creates a directory on your CentOS installation.

The second command links that directory to the one you selected earlier.

Page 48: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

48

CS@VT ©2013-2016 McQuain

Backing up Your Work

I recommend you use the backup script shown in the CS 2505 notes to maintain

a frequently-updated backup of your work on your rlogin account.

It is also relatively simple to modify that script so that it will copy a backup tar file

to a shared folder.

Page 49: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

49

CS@VT ©2013-2016 McQuain

Backing up the VM

You can create a backup image of your virtual machine.

This is useful for at least two reasons:

- You can transfer the image to a different machine and load it into VirtualBox

there, so you have multiple, consistent virtual machines.

- You can save a current image of your virtual machine in case something

damages the version you're using.

Note: shutting your virtual machine down improperly may damage it so that it will

no longer boot.

Page 50: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

50

CS@VT ©2013-2016 McQuain

Backing up the VM

To back up your VM: Choose the VM to back up:

Choose the location: Specify any additional settings:

Page 51: Get VirtualBox - Coursescourses.cs.vt.edu/.../VirtualBox5_CentOS7_Setup.pdfVirtualBox/CentOS Setup Computer Organization 1 CS@VT ©2013-2016 McQuain Get VirtualBox Go to and select

VirtualBox/CentOS Setup

Computer Organization

51

CS@VT ©2013-2016 McQuain

Backing up the VM

And... wait...:

The saved image (exported appliance in VirtualBox jargon) is usually much

smaller than the virtual hard disk you created earlier; in my case I got a 2 GB

export from a 32 GB virtual hard disk... so I can easily afford to store several

such backups if I want.

I strongly advise that you make a backup of your entire VM on a regular basis.