路漫漫其修远兮
吾将上下而求索

虚拟机安装linux

1、新建虚拟机

image.png

2、

image.png

3、

image.png

4、

image.png

5、

image.png

6、

image.png

7、

image.png

8、

内存:2G

硬盘:120G

处理器:1核心

9、启动时连接

image.png

10、启动已连接

image.png

11、启动

image.png

12、

image.png

13、

image.png

14、

image.png

15、

image.png

16、

image.png

17、

image.png

18、

image.png

19、

image.png

20、

image.png

21、

image.png

22、

image.png

23、

image.png

24、

image.png

25、

image.png

26、

image.png

27、

image.png

28、

image.png

29、

image.png

30、

image.png

31、

image.png

32、

配置文件

[root@localhost ~]# cat anaconda-ks.cfg 
# Kickstart file automatically generated by anaconda.

#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard us
network --onboot no --device eth0 --bootproto dhcp --noipv6
rootpw  --iscrypted $6$eq1QVdhFM5qQ6asK$GSktrM5XnkfWszTDT0brqTeiohWNL2DgfcF9xpuaTs0ZLz.m3.2mO/CNdDunYrlUX93xehh1z5h8DsnXoFb8Q.
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
#clearpart --none

#part /boot --fstype=ext4 --size=100
#part / --fstype=ext4 --size=51200
#part swap --size=2048

#part /data --fstype=ext4 --grow --size=1


repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100

%packages
@core
@server-policy
@workstation-policy
%end

磁盘分区

[root@localhost ~]# df -Th
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/sda2      ext4    50G  689M   46G   2% /
tmpfs          tmpfs  931M     0  931M   0% /dev/shm
/dev/sda1      ext4    93M   35M   54M  40% /boot
/dev/sda5      ext4    67G   52M   64G   1% /data

[root@localhost ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  120G  0 disk 
├─sda1   8:1    0  100M  0 part /boot
├─sda2   8:2    0   50G  0 part /
├─sda3   8:3    0    2G  0 part [SWAP]
├─sda4   8:4    0    1K  0 part 
└─sda5   8:5    0 67.9G  0 part /data
sr0     11:0    1 1024M  0 rom

自动挂载

[root@localhost ~]# cat /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Thu May 18 16:47:36 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=0ee738ee-d2f3-4beb-b75e-3422d9ca47ee /                       ext4    defaults        1 1
UUID=745a4a3d-bc6d-4cfd-a849-932cb171c1b7 /boot                   ext4    defaults        1 2
UUID=ac51a143-8303-4f52-bb1d-712ed487ca14 /data                   ext4    defaults        1 2
UUID=c7ffd08c-51b8-47fc-94ce-7f104b4e0cd8 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

内存

[root@localhost ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1861        211       1649          0          8         58
-/+ buffers/cache:        144       1716
Swap:         2047          0       2047

安装结束,具体的初始化配置见其他博文

未经允许不得转载:江哥架构师笔记 » 虚拟机安装linux

分享到:更多 ()

评论 抢沙发

评论前必须登录!