Install Gentoo Linux in VMware 8.0

Source: Internet
Author: User
Tags ssh access

First, show me my VMware configurations
1. The CPU configuration is a single dual-core
2. The memory configuration is 1024 MB.
3. The video card and sound card are standard configurations.
4. The hard drive is a 20 gb scsi hard drive (if you only install Gentoo, the standard 8 GB will work. I need
Install some applications, so the hard disk configuration is 20 GB)
5. Select NAT for the NIC (My NAT network segment in VMware Is 192.168.254.0/24, and the gateway and DNS
All are 192.168.254.2)
6. The optical drive is standard and started through ISO at startup.
7. The software drive is standard and can be deleted. I have not deleted it.
I. Preparations
01. Download the installation image of starge 3
Find the latest under the http://www.gentoo.org
Or http://mirrors.sohu.com/gentoo/releases/x86/current-stage3
02. Start the VM from the CD
03. Enter ifconfig to view Nic Information
If only Net. lo is displayed, IP addresses cannot be configured.
Solution: cd/etc/init. d
Ln-s net. lo net. enp2s1
# Rc-update add net. enp2s1 default (not required here)
04. Configure the IP address. If you can obtain the IP address, you do not need to perform the following operations:
Ifconfig enp2s1 192.168.254.130 netmask 255.255.255.0 up
Route add default gw 192.168.254.2
Nano-w/etc/resolv. conf
Nameserver 192.168.254.2
Note: My VMware instance uses NAT connection, the network segment is 192.168.254.0/24, and the gateway DHCP Server
And DNS Server are both 192.168.254.2

05. Test network connectivity
Ping-c 4 www.gentoo.org
No problem. Continue. Use ifconfig to view the problem.
06. Change the root password (SSH access is required. If you install it directly, skip this step !)
Passwd
07. Start the SSH service (SSH access is required. If it is directly installed, skip this step !)
/Etc/init. d/sshd start
08. remote connection through putty (you can install it directly under VMware, but the putty window is more friendly)
Ii. Start Installation
01. Partition
Fdisk/dev/sda
Note: create partition "n", activate partition "a", change partition type "t", help "h", View "p", delete "d ", generally, there are 3 partitions, with a memory size of 100 MB or more and a partition type of 83/82/83. After editing, the system saves and exits.
02. Format partitions
Mkfs. ext2/dev/sda1
Mkswap/dev/sda2
Mkfs. ext3/dev/sda3
03. Activate swap Partition
Swapon/dev/sda2
04. Mount the partition
Mount/dev/sda3/mnt/gentoo
Mkdir/mnt/gentoo/boot
Mount/dev/sda1/mnt/gentoo/boot
05. Download and decompress the Installation File
05.1 switch to the root directory
Cd/mnt/gentoo
05.2 download the Installation File
Links http://www.gentoo.org/main/en/mirrors.xml
Find the best site. I chose the Sohu. inc (http) site and downloaded the latest starge 3 and Portage.
File.
05.3 decompress
Tar xvjpf stage * .tar.bz2
Tar-xvjf portage * .tar.bz2-C/mnt/gentoo/usr
06. Create a default download site
Mirrorselect-I-o>/mnt/gentoo/etc/portage/make. conf
Mirrorselect-I-r-o>/mnt/gentoo/etc/portage/make. conf
07. Copy DNS information
Cp-L/etc/resolv. conf/mnt/gentoo/etc/
Note if DHCP is used in step 1 of "Preparation", You need to manually configure the DNS file.
08. Load partitions
Mount-t proc none/mnt/gentoo/proc
Mount-o bind/dev/mnt/gentoo/dev
09. chroot to the new environment
Chroot/mnt/gentoo/bin/bash
Env-update & source/etc/profile
Export PS1 = "(chroot) $ PS1"
10. Update the Portage tree.
Emerge -- sync
11. Switch the Profile. I only use gnome.
Eselect profile list
Eselect profile set 4
12. Specify locale
Nano-w/etc/locale. gen
Write the following code
En_US ISO-8859-1
En_US.UTF-8 UTF-8
Zh_CN GB18030
Zh_CN.GBK GBK
Zh_CN.GB2312 GB2312
Zh_CN.UTF-8 UTF-8
Run it
Locale-gen
13. Edit Environment Variables
Nano-w/etc/env. d/02 locale
Write the following code
LANG = "en_US"
LC_CTYPE = "zh_CN.UTF-8"
Update proflie
Env-update & source/etc/profile
14. modify the system language (skip this step)
Locale
Export LANG = en_US
Export LC_CTYPE = zh_CN.GB2312
Locale
15. Configure the time zone
Cp/usr/share/zoneinfo/Asia/Chongqing/etc/localtime (case sensitive)
16. Install and edit the kernel (difficult points)
16.1 download the kernel
Emerge gentoo-sources
16.2 edit the kernel
Cd/usr/src/linux
Make menuconfig
Configurations to be added to VMware
--> Device Drivers --> SCSI device support --> <*> SCSI disk support
--> Device Drivers --> SCSI device support --> SCSI low-level drivers -->
<*> BusLogic SCI support-
--> Device Drivers --> Fusion MPT device support --> All
--> Device Drivers --> USB support --> <*> USB Mass Storage support
--> Device Drivers --> Network Devices support --> Ethernet driver support (NEW) -->
<*> AMD PCnet32 PCI support
--> Device Drivers --> Generic Driver Options --> Maintain a devtmpfs filesystem to mount at/dev
--> Automount devtmpfs at/dev, after the kernel mounted the rootfs

--> Processor type and features --> Processor family --> Pentium M
--> Select under File System (based on your own needs)
EXT2 File System support (Second extended fs support)
EXT3 File System Support
EXT4 File System Support
In fact, I only use the EXT4 file system. Other files can be added later, including the NFS file system and windows partition support, of course, by default, we still have a lot to delete, that is, system optimization. We will not discuss it here.
16.3 compile the kernel
Make & make modules_install

17. Copy the kernel file to the startup zone.
Cp arch/i386/boot/bzImage/boot/kernel-3.10.25-gentoo (remember this name
Grub menu needs)
18. Configuration System
Nano-w/etc/fstab
After it is turned on, it is changed to the following mode. "#" is followed by a comment, which needs to be removed #.
/Dev/sda1/boot ext4 noauto, noatime 1 2
/Dev/sda3/ext4 noatime 0 1
/Dev/sda2 none swap sw 0 0
/Dev/sda5/usr ext4 notatime 0 1
/Dev/cdrom/mnt/cdrom auto noauto 0 0
#/Dev/fd0/mnt/floppy auto noauto 0 0

19. Set Host Name
Nano-w/etc/conf. d/hostname
Add the following code
HOSTNAME = "model"
20. Configure the nic ip Address
Nano-w/etc/conf. d/net
Write the following code
Modules = ("ifconfig ")
Config_enp2s1 = ("192.168.254.20.netmask 255.255.255.0 brd 192.168.254.255 ")
Routes_enp2s1 = ("default via 192.168.254.2 ")
Add eth0 as default startup
Rc-update add net. enp2s1 default
If (* rc-update: service 'Net. enp2s1 'does not exist)
Ln-s/etc/init. d/net. lo/etc/init. d/net. enp2s1
Rc-update add net. enp2s1 default

21. Set the boot password (the password after the system is started)
Passwd
22. install necessary tools
22.1 log tool (required)
Emerge syslog-ng
Rc-update add syslog-ng default
22.2 Cron Daemon
Emerge vixie-cron
Rc-update add vixie-cron default
22.3 Utility
Emerge usbutils
Emerge pciutils
Emerge vim
22.4 configure the boot program and install GRUB
Emerge grub-static
Configure grub
Nano-w/boot/grub. conf
Write the following code
Default 0
Timeout 30

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

Title Gentoo Linux 3.10.25-gentoo (rescue)
Root (hd0, 0)
Kernel/boot/kernel-3.10.25-gentoo root =/dev/sda3 init =/bb
23. Create etc/mtab
Grep-v rootfs/proc/mounts>/etc/mtab
Nano/boot/grub/device. map
Delete (fd0)/dev/fd0
Grub-install -- no-floppy/dev/sda
24. Complete the installation, unmount the partition, and restart the system.
Exit
Cd
Umount/mnt/gentoo/boot/mnt/gentoo/dev/mnt/gentoo/proc
Umount/mnt/gentoo
Reboot
If it is normal, we will see a Black Start Menu. Press enter and enter the user name and password to log on.
25. Several Problems
If the system prompts that a file is unreadable, enter eselest news read new.
The above is the installation of Gentoo, excluding the installation of X interface and gnome
For the installation of the X interface and gnome, refer:

Updated on February 24

Related Article

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.