第一种方式

1.如果虚拟机登录方式为VNC,在ubuntu机器上安装vncviewer

在虚拟机的配置xml中

<graphics type="vnc" autoport="yes" keymap="en-us" listen="0.0.0.0"/>

安装vncviewer

$apt-get install vncviewer

查看该虚拟机的端口地址

$virsh vncdisplay controller

显示 :0

通过该端口地址连接该虚拟机

$vncviewer 127.0.0.1:0

 

 第二种方式

2.如果是客户端登录方式,则按照如下方案登录

虚拟机的配置xml中

    <serial type='pty'>
          <target port='0'/>
    </serial>
    <console type='pty'>
          <target type='serial' port='0'/>
    </console>

 

登录命令

$virsh console 虚拟机名称

 

但是却在界面上一直卡住在界面下:

连接到域:虚拟机名称

换码符为 ^]

原来需要设置一下:

$echo "ttyS0" >> /etc/securetty
$echo "S0:12345:respawn:/sbin/agetty/ ttyS0 115200" >> /etc/inittab
$echo "console=ttyS0" >> /etc/grub.conf

 

重新启动虚拟机

$virsh reboot 虚拟机名称

 

相关文章:

  • 2021-11-02
  • 2021-10-25
  • 2021-09-04
  • 2022-12-23
  • 2021-06-14
  • 2021-11-03
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2021-12-26
  • 2021-08-08
  • 2021-08-24
  • 2021-08-09
相关资源
相似解决方案