Install Gentoo in virtualbox

Source: Internet
Author: User

Follow the steps in the "Gentoo Linux x86 quick installation guide" and I will not describe the layout above. It's different.

Refer to the article Gentoo install virtualbox available. This article basically installs the official documentation for operations, but I have compiled the kernel successfully under usr/src.

The detailed steps are as follows:

1. Download The install-x86-minimal-20110208 image and mount it with dtlite (Virtual Drive.
2. Load the image (settings-> media) in virtualbox. Otherwise, the system prompts that the media cannot be found (which will be automatically detected previously) and enables dual-nic (first + fourth mode ).
3. Start, boot input Gentoo
4. Configure the NIC (dual Nic) with the root permission. The command is as follows:
Dhcpcd eth0
Dhcpcd eth1
5. Set the root password (used during SSH Login) command as follows

Passwd

6. Enable the SSH service and use xshell to log on to the service.
/Etc/init. d/sshd start

7. log on to Gentoo live using SSH for partitioning

For details about how to use fdisk for partitioning, refer to the article "How to Use fdisk for instance explanation" (more information was found on the official Gentoo website)

The final result is as follows:

Device boot start end blocks ID system
/Dev/sda1 1 26 208813 + 83 Linux
/Dev/sda2 27 78 417690 83 Linux
/Dev/sda3 79 1044 7759395 83 Linux

Here, I ignore the meaning of a section in the article "installing Gentoo in virtualbox 3.2.10" and have taken many detours.

8. format the drive letter
Livecd ~ # Mke2fs/dev/sda1 (use ext3 for the primary partition)
Livecd ~ # Mke2fs-J/dev/sda3 (create and activate swap partition)
Livecd ~ # Mkswap/dev/sda2 & Swapon/dev/sda2
After the hard disk is ready, start to work.
9. Mount the new file system to/mnt/Gentoo.

If you need other mount points (such as/mnt/Gentoo/BOOT), create a directory for them and mount them.
Mount/dev/sda3/mnt/Gentoo
CD/mnt/Gentoo
Mkdir boot
Mount/dev/sda1/mnt/Gentoo/boot
10. Stage File Installation

Stage3-i686-20110208.tar.bz2

CD/mnt/Gentoo

Tar xjpf stage3-i686-20110208.tar.bz2

11. Install the latest portage package

Ftp://oss.ustc.edu.cn/gentoo/snapshots/portage-latest.traar.bz2

(Do not open it in the browser. There are many snapshots, And the browser is easy to get stuck. You can download it by yourself using the download tool)

CD/mnt/Gentoo/usr

Tar xjpf portage-latest.traar.bz2
12
Mount the/proc &/dev file system, copy the/etc/resolv. conf file, and then chroot to your Gentoo environment.
Sample Code 2.16: chroot
Livecd USR # cd/
Livecd/# Mount-T proc/mnt/Gentoo/proc
Livecd/# Mount-O bind/dev/mnt/Gentoo/dev
Livecd/# cp-L/etc/resolv. CONF/mnt/Gentoo/etc/
Livecd/# chroot/mnt/Gentoo/bin/bash
Livecd/# env-Update & source/etc/profile
>>> Regenerating/etc/lD. So. cache...

13. Configure the kernel

Livecd etc # Time emerge Gentoo-Sources

Real 2m51. 435 s
User 0m58. 220 s
Sys 0m29. 890 s
Livecd etc # cd/usr/src/Linux
Livecd Linux # Make menuconfig
(Configure the kernel)
Livecd Linux # Time make-J2

(The amount of time you spend depends largely on the options you choose)
Real 3m51. 962 s
User 3m27. 060 s
Sys 0m24. 310 s

Livecd Linux # Make modules_install
Livecd Linux # cp ARCH/i386/boot/bzimage/boot/kernel

14. Install Vim

Emerge Vim

Nano is really not very convenient.

15. Configure the system

Edit/etc/fstab and replace boot, root, and swap with the actual partition name. Check whether the file system matches the one installed.

Code 2.20: fstab example
Livecd etc # Vim/etc/fstab
/Dev/sda1/boot ext2 noauto, noatime 1 2
/Dev/sda3/ext3 noatime 0 1
/Dev/sda2 none swap SW 0 0

16 configure the network

Add multiple NICs
Ln-s net. Lo et. eth1

Net. th0 already exists, and you can find its soft link to net. Lo

17. Change the root password

Passwd

(I forgot to set the password, and then use the new livecd to enter, switch to the new root, and then do this step)

18 Add non-root users
Localhost/# useradd-G users-g lp, wheel, audio, CDROM, portage, Cron-M cherish
Localhost/# passwd cherish

Install a system log such as syslog-ng and a Cron Daemon such as vixie-cron and add them to the default running level.
Note: The Cron Daemon depends on MTA. Mail-MTA/ssmtp will be installed together due to dependencies. If you want to use a more advanced MTA, you can install it now. If it is not available now, install ssmtp first, and then uninstall and install the MTA you want.

Code 2.25: install the system log and cron daemon
Livecd Conf. D # Time emerge syslog-ng vixie-cron

Real 1m54. 099 s
User 1m2. 630 s
Sys 0m34. 620 s
Livecd Conf. D # RC-update add syslog-ng default
Livecd Conf. D # RC-update add vixie-cron default

Install necessary File System Tools (xfsprogs, reiserfsprogs or jfsutils) and network tools (dhcpcd or PPP ).

Code 2.26: install other tools
Livecd Conf. D # emerge xfsprogs (if XFS file system is used)
Livecd Conf. D # emerge jfsutils (if JFS file system is used)
Livecd Conf. D # emerge reiserfsprogs (if the Reiser file system is used)
Livecd Conf. D # emerge dhcpcd (if DHCP Client is used)
Livecd Conf. D # emerge PPP (if pppoe ADSL connection is used)

Configure the Bootstrap program

Install and configure grub.

Code 2.27: emerge grub and edit its configuration file
Livecd Conf. D # Time emerge grub

Real1m4. 634 s
User 0m39. 460 s
Sys 0m15. 280 s
Livecd Conf. D # nano-W/boot/GRUB/grub. conf

Code 2.28: grub. conf example
Default 0
Timeout 10

Title Gentoo
Root (hd0, 0)
Kernel/boot/kernel root =/dev/sda3

Code 2.29: Install grub
Livecd Conf. D # grub
Probing devices to guess BIOS drives. This may take a long time.

Grub> root (hd0, 0)
Filesystem type is ext2fs, partition type 0xfd

Grub> setup (hd0)
Checking if "/boot/GRUB/stage1" exists... yes
Checking if "/boot/GRUB/stage2" exists... yes
Checking if "/boot/GRUB/e2fs_stage1_5" exists... yes
Running "embed/boot/GRUB/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
Succeeded
Running "Install/boot/GRUB/stage1 (hd0) (hd0) 1 + 16 P (hd0, 0)/boot/GRUB/stage2/boot/
Grub/menu. lst "... succeeded
Done.

Grub> quit

Restart

Log out of the chroot environment, Uninstall all file systems, and restart:

Code 2.30: restart
Livecd Conf. D # exit
Livecd/# umount/mnt/Gentoo/dev/mnt/Gentoo/proc/mnt/Gentoo/boot/mnt/Gentoo
Livecd/# reboot
(Do not forget to remove the disc)

Complete installation

--------------

TIPS:

1. Install the Gentoo package and compile it. To solve the dependency, it takes a long time to install the package at least. Please wait.

2. Gentoo's conciseness and customization make it difficult to install. However, you can also learn many things. There are still many ways to learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.