Step by Step Install of Fedora on VirtualBox
Very simple-minded step through for putting Fedora on VirtualBox. Modern Linux install is pretty straightforward and this file is probably pretty redundant, but I have found over the years that a lot of information is too advanced for me.
This is just a simple, default install of Fedora 32 bit (version 22 at time of typing) on Virtual Box. Host is Win 7 64 bit.
(1) Downloaded the net install iso image. I went to http://mirror.aarnet.edu.au/pub/fedora/linux/releases/22/Workstation/i386/iso/Fedora-Workstation-netinst-i386-22.iso Why it is buried under ‘workstation‘ I do not know.
(2) Opened VirtualBox (VB) and selected ‘New’ and called it whatever.
(3) Selected RAM, disk size and so on. Upped the defaults a bit since the host is a reasonably capable machine.
(4) Selected ‘Storage’ and put the iso in the virtual disk drive.
(5) Double clicked the icon for the VM to boot it and when it got to the Fedora menu, chose ‘Install’
(6) Let it go for a bit.
(7) Chose language and waited a bit more. I had a little exclamation mark on the ‘Installation Source’ icon, but the installer went to the web and found a mirror and eventually all I had to do was click on ‘Automatic Partitioning’.
(8) Clicked. Said OK (default is fine for this). Then set installation destination:
(9) Chose software. I just asked for MATE and some development tools. I prefer to add things in a more fine-grained way later.
(10) Went to ‘Network’ page and just put in a hostname.
(11) Clicked ‘Begin Installation’.
(12) Set root password.
(13) Created a user (c’est moi). Made them an admin so they can use ‘sudo’ to run commands.
(14) And away it went…downloaded and installed. Man, this is easy!
(15) VB ‘Devices’ menu (at top of virtual machine, VM) -> Removed disk from optical drive.
(17) Said it can’t boot, needs processor with PAE.
(18) Alternative 1: Choose the non-PAE kernel from the boot menu…
(19) Alternative 2 – go to ‘System’ settings for the VM and enable ‘PAE/NX’ in the ‘Processor’ tab. I chose option 2.
(20) Guest additions – these allow shared folders between host and guest, and better control of the screen size and so forth for the VM. Essential. Went to ‘Devices’ and ‘Insert Guest Additions CD image’.
(21) Opened the ‘Computer’ file browser on the guest and found the disk. In my case it turned out to be in:
(22) At command prompt, cd to that directory and typed:
(23) Problem – VB needs to install some kernel modules and cannot make and install kernel modules without some development tools…
(24) VBoxLinuxAdditions.run output suggested typing:
sudo yum install kernel-devel-<version number>-.fc22.i686+PAE
(this line was given by the VBoxLinuxAdditions.run output, so I did not need to hunt for the right package name)…
(25) …except that did not work… what package has the Linux kernel headers?
(26) This one: typed:
sudo dnf install kernel-PAE-devel
(dnf is the new package manager, rather than yum)
(27) Now retry: sudo ./VBoxLinuxAdditions.run
(28) Answer prompts – yes, I wish to proceed
(29) Seemed to work. Rebooted.
(30) Under VB menu at top of window, ‘Device -> Shared Clipboard’ chose enable, probably bidirectional.
(31) OK, now set up shared folders.
(32) Fired up VM if not already. Created a folder on guest to share, say:
sudo mkdir /mnt/shareguest
then make sure it is writeable with:
chmod 777 /mnt/shareguest
This may be a good idea on the host as well, I’m not sure. May help if it is a Linux host…
(33) On the host, created a folder to share as well. I called it sharehost
(34) On the menu at the top of the guest, selected ‘Devices -> Shared Folders -> Shared Folders Settings -> Add Folder Icon’ (i.e., clicked the folder plus a plus sign icon on the right).
(35) Selected the folder on the host (easiest to use the pull down menu to select ‘Other’ and then browse). Selected ‘Make permanent’ and ‘Automount’; why not.
(36) Now VB knows about the folder on the host. What about the guest?
(37) Back on guest at command line, typed:
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) sharehost /mnt/shareguest
This just tells the mount command that the filesystem type (-t) is vboxsf, and then gives it some options regarding access, then tells it what to mount and where.
(38) cd /mnt/shareguest
(39) touch testfile
(this made a little empty file in the shared directory – does it show up on the host?)
(40) Now looked at sharedhost to see if testfile appeared.
(41) OK, it did. Now, what if we want the shared folder to mount on boot?
(42) I can’t be bothered. I just put the above mount command into a small executable script called ‘mount_share’ and stuck that in /home/username/bin directory on the guest…
(43) vi ~/bin/mount_share
(44) Put the line in, saved file.
(45) Made it executable:
chmod +x ~/bin/mount_share
(46) That was good enough. Now can get files in and out of the VM, can install software using yum/dnf, so it is effectively done.
(47) Except I want the system to get its updates from aarnet not from whatever it is defaulting to. Looked here. I have emailed aarnet maintainers ‘cos I can’t find their .repo file; most people will use a different repo anyway.
(48) Oh, and basic maintenance:
sudo dnf check-update
sudo dnf upgrade