美好的一天,
我试图通过使用我提供的图像来使用KVM来启动VM .
我能够成功创建VM,但问题是我无法访问其控制台 .
我使用ssh远程连接到我的服务器(ubuntu 14.04)并安装了以下软件包:
安装包:
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder
bridge-utils virtinst virt-viewer vncviewer -y
这是我用来创建实例的命令:
virt-install --graphic vnc --connect qemu:///system --virt-type kvm
--name licenseServer --ram 2048 --vcpus=2
--disk path=/var/lib/libvirt/images/licenseServer.img,size=10
--cdrom=/root/licenseServer.qcow2 --bridge br0
输出:
Starting install...
Creating domain... | 0 B 00:00
error: XDG_RUNTIME_DIR not set in the environment.
Cannot open display:
Run 'virt-viewer --help' to see a full list of available command line options
Domain installation still in progress. You can reconnect to the console
to complete the installation process.
实例创建:
Id Name State
----------------------------------------------------
4 licenseServer running
我必须解决这个问题的唯一参考如下:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1074418
root中的变量XDG_RUNTIME_DIR显示为空 .
你能帮我解决问题所以我可以通过以下方式连接到VM控制台:
virt-viewer --connect qemu:/// system licenseServer
我尝试使用ssh -X连接到服务器并使用上面的命令,但没有运气 .
1 回答
你有X吗?
How to install KVM on Ubuntu 14.04 LTS Headless Server
请记下端口值(即5901) . 您需要使用SSH客户端来设置隧道,并使用VNC客户端来访问远程vnc服务器 .
访问来宾域的VNC控制台
输入以下SSH端口转发命令:
哪里,
ssh vivek@server1.cyberciti.biz
- 在server1.cyberciti.biz主机上 Build 到远程KVM主机的SSH会话 .-L
- 启动本地端口转发 .5901:127.0.0.1:5901
- 设置隧道,即通过Internet传递流量以访问远程服务器127.0.0.1和端口5901.有关详细信息,请参阅“通过Internet设置SSH到隧道VNC流量” .一旦 Build 了ssh隧道,就可以将VNC客户端指向您自己的127.0.0.1(localhost)地址和端口5901,如下所示: