[root@gmnode14 vm01-CentOS-5.5]# virt-install -n vm01-CentOS-5.5 -r 1024 --vcpus=4 -f vm01-CentOS-5.5.img -s 20 --nographic -l nfs:10.10.113.14:/opt/CentOS/mirrors/5.5
-------------------------
virt-install 参数解析:
-n vm01-CentOS-5.5 # 虚拟机的名称,这里我们的名称是 vm01-CentOS-5.5
-r 1024 # 虚拟机的最大内存,单位 MB 。这里我们的内存是 1G
--vcpus=4 # 虚拟机的 CPU 数量,这里我们的数量是 2 个
-f vm01-CentOS-5.5.img # 虚拟机虚拟硬盘的名称,我们这里用 vm01-CentOS-5.5.img
--nographic # 不安装图形界面。
-l nfs:10.10.113.14:/opt/CentOS/mirrors/5.5 # 系统的镜像路径。 Xen 只支持 FTP/HTTP/NFS
-------------------------
创建完毕,在当前目录下,生成镜像文件 vm01-CentOS-5.5.img;
在 /etc/xen 目录下,生成虚拟机配置文件 vm01-CentOS-5.5;
[root@gmnode14 xen]# cat /etc/xen/vm01-CentOS-5.5
name = "vm01-CentOS-5.5"
uuid = "0283f36d-c95a-521b-737d-e400ca657029"
maxmem = 1024
memory = 1024
vcpus = 4
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
disk = [ "tap:aio:/local/Xen_zkl/vm01-CentOS-5.5/vm01-CentOS-5.5.img,xvda,w" ]
vif = [ "mac=00:16:36:40:43:85,bridge=virbr0,script=vif-bridge" ]
然后进入安装界面,参考 :
鸟哥的 Linux ,使用Xen创建虚拟机
http://linux.vbird.org/linux_enterprise/xen.php#other_inst_inst
---------------------------------------------------------------------------------------------------------------
创建日志:
[root@gmnode14 vm01-CentOS-5.5]# virt-install -n vm01-CentOS-5.5 -r 1024 --vcpus=4 -f vm01-CentOS-5.5.img -s 20 --nographic -l nfs:10.10.113.14:/opt/CentOS/mirrors/5.5
开始安装......
搜索文件 .treeinfo...... | 417 B 00:00
搜索文件 vmlinuz...... | 2.0 MB 00:00
搜索文件 initrd.img...... | 7.7 MB 00:00
创建存储文件...... | 20 GB 00:00
创建域...... | 0 B 00:01
l???? vm01-CentOS-5.5
???·蟞]
Bootdata ok (command line is method=nfs:10.10.113.14:/opt/CentOS/mirrors/5.5)
Linux version 2.6.18-194.el5xen ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 15:34:40 EDT 2010
BIOS-provided physical RAM map:
Xen: 0000000000000000 - 0000000040800000 (usable)
No mptable found.
Built 1 zonelists. Total pages: 264192
Kernel command line: method=nfs:10.10.113.14:/opt/CentOS/mirrors/5.5
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2300.092 MHz processor.
Console: colour dummy device 80x25
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Software IO TLB disabled
Memory: 1010688k/1056768k available (2512k kernel code, 37164k reserved, 1396k data, 184k init)
Calibrating delay using timer specific routine.. 5758.47 BogoMIPS (lpj=11516953)
Security Framework v1.0.0 initialized
SELinux: Initializing.
selinux_register_security: Registering secondary module capability
Capability LSM initialized as secondary
Mount-cache hash table entries: 256
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 2
(SMP-)alternatives turned off
Brought up 1 CPUs
checking if image is initramfs... it is
Grant table initialized
NET: Registered protocol family 16
Initializing CPU#1
migration_cost=8292
migration_cost=Initializing CPU#2
8292
migration_cost=Initializing CPU#3
8292
Brought up 4 CPUs
PCI: setting up Xen PCI frontend stub
ACPI: Interpreter disabled.
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI: disabled
xen_mem: Initialising balloon driver.
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: System does not support PCI
PCI: System does not support PCI
NetLabel: Initializing
NetLabel: domain hash size = 128
NetLabel: protocols = UNLABELED CIPSOv4
NetLabel: unlabeled traffic allowed by default
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 7, 524288 bytes)
TCP established hash table entries: 262144 (order: 10, 4194304 bytes)
TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
audit: initializing netlink socket (disabled)
type=2000 audit(1303393164.129:1): initialized
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
Initializing Cryptographic API
alg: No test for crc32c (crc32c-generic)
ksign: Installing public key data
Loading keyring
- Added public key C596239A507DE7FD
- User ID: CentOS (Kernel Module GPG key)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
rtc: IRQ 8 is not free.
Non-volatile memory driver v1.2
Linux agpgart interface v0.101 (c) Dave Jones
brd: module loaded
Xen virtual console successfully installed as xvc0
Bootdata ok (command line is method=nfs:10.10.113.14:/opt/CentOS/mirrors/5.5)
Linux version 2.6.18-194.el5xen ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 15:34:40 EDT 2010
BIOS-provided physical RAM map:
Xen: 0000000000000000 - 0000000040800000 (usable)
No mptable found.
Built 1 zonelists. Total pages: 264192
Kernel command line: method=nfs:10.10.113.14:/opt/CentOS/mirrors/5.5
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2300.092 MHz processor.
Console: colour dummy device 80x25
Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes)
Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Software IO TLB disabled
Memory: 1010688k/1056768k available (2512k kernel code, 37164k reserved, 1396k data, 184k init)
Calibrating delay using timer specific routine.. 5758.47 BogoMIPS (lpj=11516953)
Security Framework v1.0.0 initialized
SELinux: Initializing.
selinux_register_security: Registering secondary module capability
Capability LSM initialized as secondary
Mount-cache hash table entries: 256
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 2
(SMP-)alternatives turned off
Brought up 1 CPUs
checking if image is initramfs... it is
Grant table initialized
NET: Registered protocol family 16
Initializing CPU#1
migration_cost=8292
migration_cost=Initializing CPU#2
8292
migration_cost=Initializing CPU#3
8292
Brought up 4 CPUs
PCI: setting up Xen PCI frontend stub
ACPI: Interpreter disabled.
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI: disabled
xen_mem: Initialising balloon driver.
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: System does not support PCI
PCI: System does not support PCI
NetLabel: Initializing
NetLabel: domain hash size = 128
NetLabel: protocols = UNLABELED CIPSOv4
NetLabel: unlabeled traffic allowed by default
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 7, 524288 bytes)
TCP established hash table entries: 262144 (order: 10, 4194304 bytes)
TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
audit: initializing netlink socket (disabled)
type=2000 audit(1303393164.129:1): initialized
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
Initializing Cryptographic API
alg: No test for crc32c (crc32c-generic)
ksign: Installing public key data
Loading keyring
- Added public key C596239A507DE7FD
- User ID: CentOS (Kernel Module GPG key)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
rtc: IRQ 8 is not free.
Non-volatile memory driver v1.2
Linux agpgart interface v0.101 (c) Dave Jones
brd: module loaded
Xen virtual console successfully installed as xvc0
Event-channel device installed.
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
ide-floppy driver 0.99.newide
usbcore: registered new driver hiddev
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
PNP: No PS/2 controller found. Probing ports directly.
i8042.c: No controller found.
mice: PS/2 mouse device common for all mice
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
TCP bic registered
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
Welcome to CentOS
+---------+ Choose a Language +---------+
| |
| What language would you like to use |
| during the installation process? |
| |
| Catalan ^ |
| Chinese(Simplified) : |
| Chinese(Traditional) # |
| Croatian : |
| Czech : |
| Danish : |
| Dutch : |
| English v |
| |
| +----+ |
| | OK | |
| +----+ |
| |
| |
+---------------------------------------+
<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen
XENBUS: Device with no driver: device/vbd/51712
XENBUS: Device with no driver: device/vif/0
Initalizing network drop monitor service
Write protecting the kernel read-only data: 483k
Greetings.
anaconda installer init version 11.1.2.209 starting
mounting /proc filesystem... done
creating /dev filesystem... done
mounting /dev/pts (unix98 pty) filesystem... done
mounting /sys filesystem... done
anaconda installer init version 11.1.2.209 using /dev/xvc0 as console
trying to remount root filesystem read write... done
mounting /tmp as ramfs... done
running install...
running /sbin/loader
按提示做选择
Welcome to CentOS
+------------------+ Package Installation +------------------+
| |
| Name : system-config-network-tui-1.3.99.18-1.el5-noarch |
| Size : 4852k |
| Summary: The NEtwork Adminstration Tool |
| |
| |
| 100% |
| |
| Packages Bytes Time |
| Total : 1058 2959M 0:28:11 |
| Completed: 893 2228M 0:21:13 |
| Remaining: 165 731M 0:06:58 |
| |
| 75% |
| |
+------------------------------------------------------------+
<Space>,<+>,<-> selection | <F2> Group Details | <F12> next screen
XENBUS: Device with no driver: device/vbd/51712
XENBUS: Device with no driver: device/vif/0
Initalizing network drop monitor service
Write protecting the kernel read-only data: 483k
Greetings.
anaconda installer init version 11.1.2.209 starting
mounting /proc filesystem... done
creating /dev filesystem... done
mounting /dev/pts (unix98 pty) filesystem... done
mounting /sys filesystem... done
anaconda installer init version 11.1.2.209 using /dev/xvc0 as console
trying to remount root filesystem read write... done
mounting /tmp as ramfs... done
running install...
running /sbin/loader