我正在尝试使用 KVM 启动 Snappy 的虚拟映像。
Launch Snappy locally with KVM on Linux
找到了一个很好的和简单的方法在 Linux 上使用 KVM 本地启动 Snappy
已完成以下步骤:
$ sudo apt-get install qemu-kvm
$ kvm-ok
Command 'kvm-ok' is available in '/usr/sbin/kvm-ok'
The command could not be located because '/usr/sbin' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative privileges associated with your user account.
kvm-ok: command not found
$ sudo kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
$ wget http://releases.ubuntu.com/15.04/ubuntu-15.04-snappy-amd64-generic.img.xz
$ unxz ubuntu-15.04-snappy-amd64-generic.img.xz
到目前为止一切顺利,直到下一步......
$ kvm -m 512 -redir :8090::80 -redir :8022::22 ubuntu-15.04-snappy-amd64-generic.img
输出结果如下:
(process:32493): GLib-WARNING **: /build/glib2.0-Lm6jKr/glib2.0-2.45.7/./glib/gmem.c:482: custom memory allocation vtable not supported
qemu-system-x86_64: invalid host forwarding rule ':8022:22'
qemu-system-x86_64: Device 'user' could not be initialized
答案1
如果您错误地输入了重定向字符串,就会收到此错误消息。
如果您确实输入了“-redir:8022::22”(而不是-redir:8022:22或8022::22),那么它应该可以工作。