歡迎您光臨本站 註冊首頁

請教,在centos5.5的xen中運行虛擬機。望大牛們指點~~~

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

請教,在centos5.5的xen中運行虛擬機。望大牛們指點~~~

我的/etc/xen/vm03 配置文件如下:

name= "vm03"
kernel = "/boot/vmlinuz-2.6.18-194.3.1.el5.centos.plusxen"
ramdisk ="/boot/initrd-2.6.18-194.3.1.el5.centos.plusxen.img"
maxmem = 1024
memory = 1024
vcpus = 2
disk = ["tap:aio:/xen/vm01.img,sda1,w"]
vif = [ "" ]
root = "/dev/sda1 ro "
~

vm01.img中有完整的"/"文件系統,initrd等文件也是重新生成的,在啟動虛擬機時,不能繼續,不知道為什麼,下面是信息,還望大牛們賜教啊~~~


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(1275990772.678: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 5D549C9CC0715923
- 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  root=/dev/sda1 ro )
Linux version 2.6.18-194.3.1.el5.centos.plusxen (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Wed May 19 09:59:34 EDT 2010
BIOS-provided physical RAM map:
Xen: 0000000000000000 - 0000000040800000 (usable)
No mptable found.
Built 1 zonelists.  Total pages: 264192
Kernel command line:  root=/dev/sda1 ro
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2660.024 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: 1014272k/1056768k available (2513k kernel code, 33748k reserved, 1395k data, 184k init)
Calibrating delay using timer specific routine.. 6653.35 BogoMIPS (lpj=13306702)
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: 32K, L1 D cache: 32K
CPU: L2 cache: 256K
CPU: L3 cache: 12288K
CPU: Physical Processor ID: 1
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=2575
Brought up 2 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(1275990772.678: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 5D549C9CC0715923
- 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
XENBUS: Device with no driver: device/vbd/2049
XENBUS: Device with no driver: device/vif/0
Initalizing network drop monitor service
Write protecting the kernel read-only data: 483k
Red Hat nash version 5.1.19.6 starting
Mounting proc filesystem
Mounting sysfs filesystem
Creating /dev
Creating initial device nodes
Setting up hotplug.
Creating block device nodes.
Loading xenblk.ko module
Registering block device major 8
Loading xennet.ko module
netfront: Initialising virtual ethernet driver.
netfront: device eth0 has flipping receive path.
Loading ehci-hcd.ko module
Loading ohci-hcd.ko module
Loading uhci-hcd.ko module
USB Universal Host Controller Interface driver v3.0
Loading xfs.ko module
SGI XFS with ACLs, security attributes, large block/inode numbers, no debug enabled
SGI XFS Quota Management subsystem
Loading dm-mem-cache.ko module
Loading dm-mod.ko module
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.11.5-ioctl (2007-12-12) initialised: dm-devel@redhat.com
Loading dm-log.ko module
Loading dm-region_hash.ko module
Loading dm-message.ko module
Loading dm-raid45.ko module
device-mapper: dm-raid45: initialized v0.2594l
Scanning and configuring dmraid supported devices
Creating root device.
Mounting root filesystem.
Filesystem "sda1": Disabling barriers, trial barrier write failed
XFS mounting filesystem sda1
Starting XFS recovery on filesystem: sda1 (logdev: internal)
Ending XFS recovery on filesystem: sda1 (logdev: internal)
Setting up other filesystems.
Setting up new root fs
no fstab.sys, mounting internal defaults
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
SELinux:  Disabled at runtime.
type=1404 audit(1275990776.930:2): selinux=0 auid=4294967295 ses=4294967295
INIT: version 2.86 booting
                Welcome to  CentOS release 5.5 (Final)
                Press 'I' to enter interactive startup.
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Setting clock  (utc): Tue Jun  8 17:52:57 CST 2010 [  OK  ]
Starting udev: [  OK  ]
Loading default keymap (us): [  OK  ]
Setting hostname manager:  [  OK  ]
No devices found
Setting up Logical Volume Management: [  OK  ]
Checking filesystems
Checking all file systems.
fsck.xfs -a /dev/sda1
/sbin/fsck.xfs: XFS file system.
[  OK  ]
Remounting root filesystem in read-write mode:  [  OK  ]
Mounting local filesystems:  mount: nfsd already mounted or /proc/fs/nfsd busy
mount: sunrpc already mounted or /var/lib/nfs/rpc_pipefs busy

Enabling local filesystem quotas:  [  OK  ]
Enabling /etc/fstab swaps:  [  OK  ]
INIT: Entering runlevel: 3
Entering non-interactive startup
Applying Intel CPU microcode update:
Starting background readahead: [  OK  ]
Applying iptables firewall rules: [  OK  ]
Bringing up loopback interface:  [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.
[  OK  ]
Starting system logger:   syslogd: /export/logs/world2.syslog: No such file or directory
  syslogd: /export/logs/world2.java: No such file or directory
[  OK  ]
Starting kernel logger: [  OK  ]
Starting irqbalance: [  OK  ]
Starting portmap: [  OK  ]
Starting openvpn: [  OK  ]
Starting snmpd: [  OK  ]
Starting sshd: [  OK  ]
Starting xinetd: [  OK  ]
ntpd: Synchronizing with time server:
Starting ntpd: [  OK  ]
Starting NFS services:  [  OK  ]
Starting NFS quotas: [  OK  ]
Starting NFS daemon: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
NFSD: starting 90-second grace period
[  OK  ]
Starting NFS mountd: [  OK  ]
Starting RPC idmapd: [  OK  ]
Starting dhcpd:
Starting crond: [  OK  ]
Starting jexec:  Starting jexec services[  OK  ]
Starting background readahead: [  OK  ]
rm: cannot remove `/tmp/cricket-subtree-*': No such file or directory
/etc/rc3.d/S99local: line 13: /root/bin/startlogs.sh: No such file or directory
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
Using CATALINA_BASE:   /usr/local/apache-tomcat-default
Using CATALINA_HOME:   /usr/local/apache-tomcat-default
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-default/temp
Using JRE_HOME:        /usr/java/default
Using CLASSPATH:       /usr/local/apache-tomcat-default/bin/bootstrap.jar
《解決方案》

不是已經啟動了嗎
《解決方案》

回復 2# leaf1981
   

但是我不明白為什麼停在這裡不動了。。感覺應該是有login的啊?
在這種狀態下,怎麼看內核自動獲取的ip地址?謝謝解答
《解決方案》

好像是你的vm鏡像有點問題

ip如果是dhcp的,用物理機上vnc上連進去看
《解決方案》

回復 4# initsys


    能說詳細點嗎?從物理機怎麼用vnc連虛擬機?我現在不知道虛擬機獲得的ip地址是多少?
《解決方案》

如果能練到物理機的xwindows或者vnc的話,用virt-manager

如果不行,需要編輯vm的配置文件,以xen為例,在domu的配置文件里,加上類似下面幾行:
vnc = 1         # 為vm創建vnc
vncunused = 0     # 隨機選擇vnc埠,也可指定
vnclisten="0.0.0.0" # vnc監聽ip
vncpasswd='xxxxx'  # 可選

如果是kvm,在qemu的啟動參數里加vnc,或者該libvirt的xml配置文件,google一下就能找到
《解決方案》

xm console vm03
《解決方案》

回復 6# initsys

好的,謝謝~~~
《解決方案》

最後還啟動了tomcat?
如果卡在 老貓那,也許可以去掉 tomcat的自動啟動,然後進系統手動啟動看看。
可能老貓昨晚看球去了, 工作的時候在打盹

[火星人 ] 請教,在centos5.5的xen中運行虛擬機。望大牛們指點~~~已經有1174次圍觀

http://coctec.com/docs/service/show-post-5616.html