vm虚拟机使用kickstart自动安装linux教程
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
在vm虚拟机中用kickstart自动安装linux教程
学习完kickstart,想尝试下在VM虚拟机中实现无人值守安装linux系统。通过U盘来引导。
1 准备kickstart文件
下面是kickstart文件:
# System timezone
timezone Asia/Shanghai
ignoredisk --drives=sdb1
bootloader --driveorder=sda
bootloader --location=mbr --driveorder=sda,sdb --append="nomodesetcrashkernel=auto rhgb quiet"
# Network information设置IP、网关等
network --bootproto=static --device=eth0 --gateway=192.168.4.1 --ip=192.168.4.199 --hostname= --nameserver=219.141.136.10 --netmask=255.255.255.0 --onboot=on --noipv6 #network --bootproto=static --device=eth1 --ip=10.12.1.240 --netmask=255.255.255.0 --onboot=on --noipv6
# System bootloader configuration
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=8192
part / --fstype="ext4" --grow --size=1
user --name=javadev
%packages
@base
@basic-desktop
@chinese-support
@compat-libraries
@console-internet
@debugging
@fonts
@graphical-admin-tools @legacy-unix
@network-tools
@performance
@scientific
@system-admin-tools
@system-management-snmp compat-openmpi
compat-openmpi-psm
dump
httpd
ftp
iptraf
jwhois
logwatch
mutt
net-snmp-perl
net-snmp-python
nmap
rrdtool
rrdtool
rwho
system-config-kickstart tcp_wrappers
telnet
tftp
lm_sensors
tigervnc-server
yum-plugin-downloadonly -authconfig-gtk
-b43-fwcutter
-cas
-control-center-extra
-crash
-crash-gcore-command
-crash-trace-command
-elfutils
-elinks
-eog
-avahi
-gdm-plugin-fingerprint -gnome-applets
-gnome-disk-utility
-gnome-media
-gnome-packagekit
-gnome-packagekit
-gnome-vfs2-smb
-gok
-ibus-table-cangjie
-ibus-table-erbi
-ibus-table-wubi
-ltrace
-mdadm
-microcode_ctl
-nano
-openssh-askpass
-oprofile
-orca
-pcmciautils
-perf
-powertop
-pulseaudio-module-gconf -pulseaudio-module-x11
-rfkill
-scl-utils
-seekwatcher
-setuptool
-smartmontools
-sos
-system-config-users
-units
-valgrind
-vconfig
-vino
-wireless-tools
-words
%post
# Install the yum repository configuration files
#post you will need to add it here
/bin/echo "nameserver 8.8.8.8" > /etc/resolv.conf
#下文为自动执行脚本,自动安装puppet、拷贝oracle安装程序等,如果不需要可注释
cd /tmp
/bin/rpm -ivh "/pub/epel/6/x86_64/epel-release-6-8.noarch.rp m"
/bin/rpm -ivh "/el/6/products/x86_64/puppetlabs-release-6-7.no arch.rpm"
/usr/bin/wget
"/rpmforge-release/rpmforge-release-0.5.3-1.el6. rf.x86_64.rpm"
/bin/rpm -ivh ./rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
/bin/mkdir -p /home/software /tmp/mnt
/bin/mount /dev/sdb2 /tmp/mnt
#/bin/cp -prf /tmp/mnt/*.rpm /home/software/
/bin/rpm -ivh /home/software/*.rpm
/bin/rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6