Install Linux on your Macintosh or Microsoft Windows PC

We will install the application VirtualBox on your Mac or PC, and then install the Linux operating system into VirtualBox.

1. Install VirtualBox on your Mac or PC

  1. Find out what type of processor you have, just in case you need to know later. On my Mac, I pulled down the apple and selected About This Mac. I discovered I had a 2.5 GHz Intel Core i5. On my Windows 7 Home Premium, I went to
    start → Control Panel → System and Security → System
    and discovered I had a
    Processor: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz 2.00 GHz
    System type: 64-bt Operating System
  2. Go to the VirtualBox website and download VirtualBox. I downloaded it on May 28, 2013. For my Mac, I selected “VirtualBox 4.2.12 for OS X hosts x86/amd64” and downloaded the file
    http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2.12-84980-OSX.dmg.
    For my PC, I selected “VirtualBox 4.2.12 for Windows hosts x86/amd64” and downloaded the file
    http://download.virtualbox.org/virtualbox/4.2.12/VirtualBox-4.2.12-84980-Win.exe.
    Running this .dmg or .exe file temporarily disconnects your computer from the Internet, so you should first close communications programs such as PuTTY.
    Welcome to the Oracle VM VirtualBox 4.2.12 Setup Wizard.
    Custom Setup: I didn’t make any changes.
    Location: C:\Program Files\Oracle\VirtualBox
    Next
  3. Would you like to install this device software?
    Say yes to all of them:
    Name: Oracle Corporation Universal Serial Bus
    Name: Oracle Corporation Network Service
    Name: Oracle Corporation Network Adapters Install
  4. Ignore the warning about “Failed to create the VirtualBox COM object”.
  5. Restart the PC. When the .exe file has finished running, you can delete it. It created a desktop shortcut named Oracle VM VirtualBox, with an icon of a blue and white cube. The VM stands for Virtual Machine.

2. Install Fedora into VirtualBox

Go to the list of Linux distributions and click on the “Popular Distributions” category. Let’s pick Fedora because (unlike the Red Hat we have here at NYU on oit.scps.nyu.edu) it’s free.

  1. Go to the Get Fedora page. I picked the Fedora 18 Desktop Edition because it’s the “Fedora Default”, and pressed the 64-bit Download Now! button. It downloaded the Fedora-18-x86_64-Live-Desktop.iso file, which was 960,495,616 bytes or 937,984 kilobytes.
  2. Launch VirtualBox by clicking on the VirtualBox icon on your desktop. In VirtualBox, press the New button.

    Create Virtual Machine
    Name and operating system
    Name: Fedora 18 Desktop Edition
    Type: Linux
    Version: Fedora (64 bit)
    Next

    Memory size
    Select the amount of memory (RAM) in megabytes to be allocated to the virtual machine. It recommeneded 768 MB, but I asked for 2048 MB because 768 MB was not enough to install the GNU C compiler gcc.
    Next

    Hard drive
    • Create a virtual hard drive now
    Create

    Hard drive file type
    • VDI (VirtualBox Disk Image)
    Next

    Storage on physical hard drive
    • Dynamically allocated
    Next

    File location and size
    Please type the name of the new virtual hard drive file into the box below or click on the folder icon to select a different folder to create the file in.
    Name: Fedora 18 Desktop Edition
    Select the size of the virtual hard drive in megabytes. This size is the limit on the amount of file data that a virtual machine will be able to store on teh hard drive.
    Size: It suggested 8.00 GB, but I asked for 16.00 GB. Otherwise, when I tried to install Fedora to the hard drive (see below), I got the following message: “Your / partition is less than 4096.0 MB which is lower than recommended for a normal Fedora install. This can happen if there is not enough space on your hard drive(s) for the installation.”
    Create
  3. The above dialog should have created the “virtual disk” file
    C:\Users\Myname\VirtualBox VMs\Fedora 18 Desktop Edition\Fedora 18 Desktop Edition.vdi
    To verify that this file exists, go back to the original Oracle VM VirtualBox Manager window and select
    File → Virtual Media Manager… Hard drives
    You should see the file Fedora 18 Desktop Edition.vdi with a virtual size of 16.00 GB. Then press Close to dismiss the Virtual Media Manager.

Launch Fedora

  1. In the Oracle VM VirtualBox Manager window, select “Fedora 18 Desktop Edition Powered Off” if it is not already selected. Press the green Start button. Dutifully read the Auto capture keyboard message and press OK.
  2. Select start-up disk
    Please select a virtual optical disk or a physical optical drive containing a disk to start your new virtual machine from.
    Select the file Fedora-18-x86_64-Live-Desktop.iso (916.00 MB) that you downloaded.
    Start

    Starting Fedora 18 in 10 seconds…
    Sign In
    Press Live System User.
  3. Welcome to Fedora.
    You are currently running Fedora from live media. You can install Fedora now, or choose "Install to Hard Drive" in the Activities Overview at any time later.
    Press the big “Install to Hard Drive” button on the right.

Install Fedora to the Hard Drive

This “hard drive” is the .vdi file you created, not your computer’s hard drive.

  1. You have pressed the big “Install to Hard Drive” button on the right.
    WELCOME TO FEDORA 18.
    What language would you like to use during the installation process?
    English (United States)
    Continue

    INSTALLATION SUMMARY
    STORAGE
    Click on the INSTALLATION DESTINATION icon.
    Select the ATA VBOX HARDDISK 16.38 GB icon to make it blue.
    Continue

    INSTALLATION OPTIONS
    You have plenty of space to install Fedora, so we can automatically configure the rest of the installation for you.
    Continue

    Don’t worry if it momentarily takes you back to INSTALLATION SUMMARY.
    Begin Installation
    CONFIGURATION
    USER SETTINGS
    Click on the ROOT PASSWORD icon.
    The root account is used for administering the system. Enter a password for the root user.
    Root Password:
    Confirm:
    Done

    Installing software 10%
    You will have to wait a long time.
    Performing post-install setup tasks
    Running post install scripts
    Fedora is now successfully installed on your system and ready for you to use! When you are ready, reboot your system to start using it!
    Quit
  2. In the upper right corner of the Fedora window, pull down “Live System User” and select Power Off. Press Power Off. To put Fedora out of its misery, pull down the Machine menu and select Close…
    • Power off the machine
    OK
  3. In the Oracle VM VirtualBox Manager window, select Fedora 18 Desktop Edition and press Settings. Ignore the “Failed to access USB subsystem” message.
    System → Motherboard → Boot Order
    Select the Hard Disk. It should be at the top of the list; move it up with the ↑ button. Keep it checked.
    OK
  4. Press the green start button to start Fedora again.
    Welcome. There are a few more steps before your system is ready to use.
    Forward

    Create User
    Full Name: (your first name and last name)
    Username: (your first name in all lowercase)
    ✓ Add to Administrator’s group
    Password:
    Confirm password:
    Forward

    Date and Time
    ✓ Synchronize date and time over the network.
    Select any one of the NTP servers. Do not press Add, Edit, or Delete.
    Finish

    Sign In: click on your name and type your password.
  5. After you sign in, you will see Activities in the upper left corner of the Fedora window.
    Activities → Show Applications (it looks like nine dots) → Terminal
    Right-click on the Terminal and select Add to Favorites. Then double-click on the Terminal to open it. Some commands you can type are
    whoami
    pwd
    ls -l
    uname -a
    exit
    
    To power off, exit from the Terminal, pull down your name in the upper right corner of the Fedora window, and select Power Off.

Install the GNU C and C++ Compilers into Fedora

This section is optional. Follow these instructions only if you want to write programs in the languages C and C++ on Fedora.

  1. fedora Sign In: click on your name and type your password.
    In the upper left corner, click on Activities. Under it, click on Applications. Scroll down to Terminal. Right-click on Terminal and select Add to Favorites. The double-click on the Terminal. to launch it. Type the following commands in the Terminal window to install the C and C++ compilers. I had to update audit before I could install gcc.
    uname -a
    pwd
    ls -l
    
    su
    Password:
    yum update audit
    yum install gcc
    Total download size: 34 M
    Is this ok [y/N]: y
    Complete!
    exit (to stop being the superuser after yum has completed the installation of gcc)
    which gcc
    /usr/bin/gcc
    man gcc
    
    su
    Password:
    yum install gcc-c++
    

Install the Guest Additions into Fedora

This section is optional. You already have a Fedora window of 1024 × 768 pixels. Follow these instructions if you want to make the window bigger.

  1. Type the following commands in the Terminal window. The `back quotes` are on the same key as the tilde. myname is the name of the acount you created. It’s probably your first name in all lowercase.
    uname -r
    3.6.10-4.fc18.x86_64
    
    su
    Password:
    yum update audit
    yum install dkms kernel-headers kernel-devel gcc
    yum install kernel-devel-`uname -r`
    
    export KERN_DIR=/usr/src/kernels/`uname -r`
    echo $KERN_DIR
    ls -ld $KERN_DIR
    
  2. We will create the file /run/media/myname/VBOXADDITIONS_4.2.12_84980/VBoxLinuxAdditions.run on your guest machine (the Fedora machine).
    su
    Password:
    

    Devices → CD/DVD Devices → Choose a virtual CD/DVD disk file…
    Choose the file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso on your host machine (your Mac or PC; it may be in a different place on Mac). It should have a blue checkmark in front of it in this menu.
    "VBOXADDITIONS_4.2.12_84980" contains software intended to be automatically started. Would you like to run it? No.

    cd /run/media/myname/VBOXADDITIONS_4.2.12_84980
    pwd
    ls -lVBoxLinuxAdditions.run
    ./VBoxLinuxAdditions.run
    Verifying archive integrity... All good.
    Uncompressing VirtualBox 4.2.12 Guest Additions for Linux...
    VirtualBox Guest Additions installer
    Removing installed version 4.2.12 of VirtualBox Guest Additions ...
    Copying additional installer modules ...
    Installing additional modules ...
    
  3. Create the files /root/xorg.conf.new and /etc/X11/xorg.conf. Ignore the “Number of created screens does not match number of detected devices” message from Xorg :1 -configure.
    su
    Password:
    
    Xorg :1 -configure
    ls -l /root/xorg.conf.new
    
    cd /etc/X11
    pwd
    
    cp /root/xorg.conf.new xorg.conf
    ls -l xorg.conf
    
  4. Edit the file /etc/X11/xorg.conf. It contains four lines that say Depth 24. Immediately after the second line that says Depth 24, insert the following line.
    		Modes "1600x1200" "1440x1050" "1280x960" "1024x768" "800x600"
    

    Then save the file and get out of the editor. Say exit to stop being the superuser. Say another exit to close the Terminal. Pull down your name in the upper right corner of the Fedora window and select Power Off. When you reboot Fedora, it will have a 1600 × 1200 window.