我有一个可用的虚拟主机,即 Ubuntu-Server Lucid (10.4)。我已经使用它一段时间了,并在 Lucid 上创建了几个功能性客户机。
今天我升级到了 Maverick,然后又升级到了 Natty (11.4)。升级很顺利,我所有的旧客户端都启动并正常运行。
我创建了一个新的客户机,当它启动时,并且日志中似乎没有错误,但我无法 ping 或 ssh 进入它。
$ virsh start stg-app2(无错误)...在“virsh list”中显示为“running”
在将客户的接口文件转换为 qcow 图像之前,我能够对其进行 cat 操作(对我来说看起来很好):
cat /tmp/somepath/etc/networking/interfaces
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.193
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.1.1
dns-search defaultdomain
創作記錄:
$ sudo vmbuilder kvm ubuntu \
> --suite lucid \
> --flavour virtual \
> --arch amd64 \
> --mem 512 \
> --rootsize 8192 \
> --swapsize 512 \
> --name 'Josh Sharpe' \
> --user jsharpe \
> --pass ASDFASDFASDFASDF \
> --hostname stg-app2 \
> --ip 192.168.1.193 \
> --mask 255.255.255.0 \
> --net 192.168.1.0 \
> --bcast 192.168.1.255 \
> --gw 192.168.1.1 \
> --addpkg openssh-server \
> --libvirt qemu:///system
2011-09-18 15:46:17,114 INFO : Calling hook: preflight_check
2011-09-18 15:46:17,173 INFO : Calling hook: set_defaults
2011-09-18 15:46:17,174 INFO : Calling hook: bootstrap
2011-09-18 15:59:43,753 INFO : Calling hook: configure_os
2011-09-18 16:00:09,693 INFO : update-alternatives: error: no alternatives for rsh.
2011-09-18 16:00:09,773 INFO : update-alternatives: error: no alternatives for rlogin.
2011-09-18 16:00:09,852 INFO : update-alternatives: error: no alternatives for rcp.
2011-09-18 16:00:11,354 INFO : Creating SSH2 RSA key; this may take some time ...
2011-09-18 16:00:11,502 INFO : Creating SSH2 DSA key; this may take some time ...
2011-09-18 16:00:12,023 INFO :
2011-09-18 16:00:12,023 INFO : Warning: Fake initctl called, doing nothing
2011-09-18 16:00:12,023 INFO :
2011-09-18 16:00:12,023 INFO : Warning: Fake initctl called, doing nothing
2011-09-18 16:00:16,148 INFO :
2011-09-18 16:00:16,149 INFO : Current default time zone: 'Etc/UTC'
2011-09-18 16:00:16,152 INFO : Local time is now: Sun Sep 18 20:00:16 UTC 2011.
2011-09-18 16:00:16,152 INFO : Universal Time is now: Sun Sep 18 20:00:16 UTC 2011.
2011-09-18 16:00:16,152 INFO :
Extracting templates from packages: 100%
2011-09-18 16:01:03,447 INFO :
2011-09-18 16:01:03,447 INFO : Current default time zone: 'Etc/UTC'
2011-09-18 16:01:03,449 INFO : Local time is now: Sun Sep 18 20:01:03 UTC 2011.
2011-09-18 16:01:03,449 INFO : Universal Time is now: Sun Sep 18 20:01:03 UTC 2011.
2011-09-18 16:01:03,449 INFO : Run 'dpkg-reconfigure tzdata' if you wish to change it.
2011-09-18 16:01:03,449 INFO :
2011-09-18 16:02:06,239 INFO : Updating certificates in /etc/ssl/certs... WARNING: Skipping duplicate certificate ca-certificates.crt
2011-09-18 16:02:06,548 INFO : 0 added, 1 removed; done.
2011-09-18 16:02:06,548 INFO : Running hooks in /etc/ca-certificates/update.d....done.
2011-09-18 16:02:12,893 INFO : restart: Unknown instance:
2011-09-18 16:02:13,535 INFO : start: Unknown parameter: JOB
2011-09-18 16:02:15,191 INFO : Calling hook: post_install
2011-09-18 16:02:15,191 INFO : Cleaning up
2011-09-18 16:02:15,192 INFO : Calling hook: preflight_check
2011-09-18 16:02:16,160 INFO : Calling hook: configure_networking
2011-09-18 16:02:16,189 INFO : Calling hook: configure_mounting
2011-09-18 16:02:16,197 INFO : Calling hook: mount_partitions
2011-09-18 16:02:16,198 INFO : Mounting target filesystems
2011-09-18 16:02:16,198 INFO : Creating disk image: "/tmp/tmpIT5W5T" of size: 8704MB
2011-09-18 16:02:16,215 INFO : Adding partition table to disk image: /tmp/tmpIT5W5T
2011-09-18 16:02:16,371 INFO : Adding type 4 partition to disk image: /tmp/tmpIT5W5T
2011-09-18 16:02:16,372 INFO : Partition at beginning of disk - reserving first cylinder
2011-09-18 16:02:16,408 INFO : Adding type 3 partition to disk image: /tmp/tmpIT5W5T
2011-09-18 16:02:16,413 INFO : [0] ../../libparted/filesys.c:148 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated
2011-09-18 16:02:16,441 INFO : Creating loop devices corresponding to the created partitions
2011-09-18 16:02:16,464 INFO : Creating file systems
2011-09-18 16:02:16,520 INFO : mke2fs 1.41.14 (22-Dec-2010)
2011-09-18 16:02:19,962 INFO : mkswap: /dev/mapper/loop0p2: warning: don't erase bootbits sectors
2011-09-18 16:02:19,963 INFO : on whole disk. Use -f to force.
2011-09-18 16:02:22,590 INFO : Calling hook: install_bootloader
2011-09-18 16:02:41,449 INFO : Searching for GRUB installation directory ... found: /boot/grub
2011-09-18 16:02:41,488 INFO : Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
2011-09-18 16:02:41,489 INFO : Searching for GRUB installation directory ... found: /boot/grub
2011-09-18 16:02:41,493 INFO : Testing for an existing GRUB menu.lst file ...
2011-09-18 16:02:41,493 INFO :
2011-09-18 16:02:41,493 INFO : Could not find /boot/grub/menu.lst file.
2011-09-18 16:02:41,494 INFO : Generating /boot/grub/menu.lst
2011-09-18 16:02:41,543 INFO : Searching for splash image ... none found, skipping ...
2011-09-18 16:02:41,657 INFO : grep: /boot/config*: No such file or directory
2011-09-18 16:02:41,716 INFO : Updating /boot/grub/menu.lst ... done
2011-09-18 16:02:41,716 INFO :
2011-09-18 16:02:41,997 INFO : Searching for GRUB installation directory ... found: /boot/grub
2011-09-18 16:02:42,023 INFO : Searching for default file ... found: /boot/grub/default
2011-09-18 16:02:42,026 INFO : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
2011-09-18 16:02:42,100 INFO : Searching for splash image ... none found, skipping ...
2011-09-18 16:02:42,126 INFO : grep: /boot/config*: No such file or directory
2011-09-18 16:02:42,189 INFO : Updating /boot/grub/menu.lst ... done
2011-09-18 16:02:42,189 INFO :
2011-09-18 16:02:42,337 INFO : Searching for GRUB installation directory ... found: /boot/grub
2011-09-18 16:02:42,342 INFO : Calling hook: install_kernel
2011-09-18 16:02:55,122 INFO : Done.
2011-09-18 16:03:00,078 INFO : Running depmod.
2011-09-18 16:03:00,133 INFO : update-initramfs: Generating /boot/initrd.img-2.6.32-33-server
2011-09-18 16:03:01,875 INFO : Running postinst hook script /usr/sbin/update-grub.
2011-09-18 16:03:01,956 INFO : Searching for GRUB installation directory ... found: /boot/grub
2011-09-18 16:03:01,983 INFO : Searching for default file ... found: /boot/grub/default
2011-09-18 16:03:01,986 INFO : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
2011-09-18 16:03:02,046 INFO : Searching for splash image ... none found, skipping ...
2011-09-18 16:03:02,079 INFO : Found kernel: /boot/vmlinuz-2.6.32-33-server
2011-09-18 16:03:02,152 INFO : Replacing config file /var/run/grub/menu.lst with new version
2011-09-18 16:03:02,170 INFO : Updating /boot/grub/menu.lst ... done
2011-09-18 16:03:02,170 INFO :
2011-09-18 16:03:03,040 INFO : Calling hook: unmount_partitions
2011-09-18 16:03:03,040 INFO : Unmounting target filesystem
2011-09-18 16:03:06,713 INFO : Calling hook: convert
2011-09-18 16:03:06,714 INFO : Converting /tmp/tmpIT5W5T to qcow2, format ubuntu-kvm/tmpIT5W5T.qcow2
2011-09-18 16:03:15,344 INFO : Calling hook: fix_ownership
2011-09-18 16:03:15,345 INFO : Calling hook: deploy
启动日志:
/var/log/libvirt/qemu/stg-app2.log
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.14 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name stg-app2 -uuid 0c4d8375-49ae-9ddc-28ca-17ac3988ff4e -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/stg-app2.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=readline -rtc base=utc -boot c -drive file=/home/jsharpe/stg-app2/ubuntu-kvm/tmpIT5W5T.qcow2,if=none,id=drive-ide0-0-0,format=qcow2 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,fd=19,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:48:94:99,bus=pci.0,addr=0x3 -usb -vnc 127.0.0.1:3 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
答案1
看来在 Natty 中你必须指定桥梁(我猜它曾经是被假定的):
添加此选项:
--bridge br0