先以root用户登录:
2.编辑以dhcp的方式获取ip
[email protected]:~# vim /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet dhcp [email protected]:~#
重启除lo网卡的所有网卡
ifdown --exclude=lo -a && sudo ifup --exclude=lo -a
编辑/etc/ssh/sshd_config
#PermitRootLogin without-passwordPermitRootLogin yes
重启 ssh 服务
[email protected]:~# sudo service ssh restart
在/etc/apt/sources.list添加条目:
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiversedeb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiversedeb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiversedeb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
关机,编辑xml文件
virsh edit ubuntu14.04-raw<channel type=‘unix‘> <source mode=‘bind‘ path=‘/var/lib/libvirt/qemu/org.qemu.guest_agent.0.ubuntu14.04-raw.sock‘/> <target type=‘virtio‘ name=‘org.qemu.guest_agent.0‘/> <address type=‘virtio-serial‘ controller=‘0‘ bus=‘0‘ port=‘1‘/></channel
注意:这个文件我在考虑要不要注释掉
<source mode=‘bind‘ path=‘/var/lib/libvirt/qemu/org.qemu.guest_agent.0.ubuntu14.04-raw.sock‘/>
安装和配置qemu-guest-agent:
[email protected]:~# sudo apt-get update[email protected]:~# sudo apt-get install qemu-guest-agent[email protected]:~# /etc/init.d/qemu-guest-agent start[email protected]:~# /etc/init.d/qemu-guest-agent status * qemu-ga is running
时间: 2025-01-08 02:12:17