Installing Gentoo in VMware Player - Part I

Written: 08/24/13

Last Updated: 09/18/16

This techtorial is the second article in my installing Gentoo in VMware Player series. It is designed to cover the first steps of installing Gentoo in the VM. If you are just now joining us, you will need to first create your virtual machine, as described in my previous article. While I am specifically focusing on an installation in VMware Player, much of this installation process is generic to a 64-bit installation of Gentoo. This article is designed to be used alongside the Gentoo handbook and will cover up through chapter four of the handbook.

Fire up the VM that we just built. If you get some sort of pop-up asking you to install VMware Tools, just click “Remind Me Later”. I will cover the installation of those tools at a later date.

gentoo-vmware-installation-part-i-1

When your VM loads you will be presented with a prompt asking you how you would like to boot from the live CD. At this screen, you will have the option to change the default kernel or hardware options. To keep things simple, we will not do any of that. Press enter at the prompt to load the default options.

gentoo-vmware-installation-part-i-2

If you are stuck at a black screen, your VM is most likely having an issue with the number of cores you specified. Try powering off the VM, editing the CPU settings to use one core, and restarting the VM. Once we are no longer using the virtual CD, you *should* be OK to go back and increase the number of cores.

If you use a keymap other than the default, “us/41” US English keymap, be prepared change it; otherwise, ignore this step. If you missed setting the keymap, reboot the VM and continue from the previous step.

gentoo-vmware-installation-part-i-3

When Gentoo has finished loading everything, you should see something like the following screen:

gentoo-vmware-installation-part-i-4

Change the root password to whatever you like. This is just the password for the current session on the live CD, not the final root password. We will set that password at a later date.

passwd

gentoo-vmware-installation-part-i-5

We need to check the network to make sure that it is working properly, as well as to see what the default network adapter’s name is. My adapter is being shown as “enp2s1”. Take note of your adapter’s name, as we will need that information at a later date.

ifconfig

gentoo-vmware-installation-part-i-6

Test if your network is working, by pinging this website. If you get a response, your network is good and nothing more is required. This should be the case, as we are simply using the host machine’s network adapter. If for whatever reason you are having issues, refer to chapter three of the Gentoo handbook.

ping -c 3 techtorials.me

gentoo-vmware-installation-part-i-7

Now that the basic initializations are done, we can move on to configuring our partition scheme. Before we can configure our partitions, we need to know what disk we are using. This printout says that my disk is “/dev/sda”, so I will be making all of my partitions on that device. If your device is different, make sure you change all references from “dev/sda” to the appropriate device.

fdisk -l

gentoo-vmware-installation-part-i-8

Start fdisk on your desired installation disk.

fdisk /dev/sda

gentoo-vmware-installation-part-i-9

Create the boot partition, giving it a size of 32 MiB. Use the default for the first cylinder size, by pressing “Enter”. This partition will hold all of the files that are required to boot Gentoo.

n
p
1

+32M

gentoo-vmware-installation-part-i-10

To be able to boot from the boot partition, it must be set to be bootable. This is accomplished by setting the boot flag.

a
1

gentoo-vmware-installation-part-i-11

Create the swap partition, giving it a size of 256 MiB. Use the default for the first cylinder size, by pressing “Enter”. The swap partition is used as virtual memory; instead of storing data in your physical memory, it will write it to the swap partition. As this is a basic VM, we should not need much space. If you are concerned that you will be running programs that will require more memory than what you assigned your VM, either increase your VM’s memory or set a larger value for the swap partition.

n
p
2

+256M

gentoo-vmware-installation-part-i-12

Set the swap partition as type “Linux swap”.

t
2
82

gentoo-vmware-installation-part-i-13

Create the root partition, giving it the remainder of the disk. Use the default for the first cylinder size and the last cylinder size, by pressing “Enter”. The root partition will be used to store the remainder of your files; this includes any required system files, all of your programs, your documents, etc….

n
p
3
 
 

gentoo-vmware-installation-part-i-14

Before we write the changes to the disk, we should first verify that everything looks good. Verify that your boot partition has the boot flag set, that your swap partition is of type “Linux swap” and that all three of your partitions are the correct size.

p

gentoo-vmware-installation-part-i-15

When you are satisfied with your partition table go ahead and write the changes to the disk. Note that this will also quit fdisk.

w

gentoo-vmware-installation-part-i-16

We now need to apply a filesystem to each of the partitions and activate the swap partition. I am using EXT4 for both the boot and the root partitions. You may use a different filesystem, if you so desire.

mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda3
mkswap /dev/sda2
swapon /dev/sda2

gentoo-vmware-installation-part-i-17

Now we can mount our filesystems, so we can access them later.

mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot

gentoo-vmware-installation-part-i-18

This concludes the first part of installing Gentoo. The next part, focuses on installing the Gentoo installation files and the base system. Click here to go to that article.

Leave a Reply