Yifei Liu
2021-Nov-15 23:13 UTC
Cannot access KVM using virsh console after KVM rebooted or shut off
Dear all, I used ssh with -X option to connect to an Ubuntu remote server where I applied virsh (libvirt) to manage my KVM virtual machines, and my local machine is MacOS. Then, I used virt-install to install a Tiny Core Linux VM, and I got a pop-up Virt Viewer window (via XQuartz) which is the console for my Tiny Core VM. However, if I rebooted my VM, then I checked the VM state by virsh list --all which was running. Then, I tried `virsh console my_vm_domain` but this command got stuck on:> Connected to domain my_vm_domain > Escape character is ^]The `virsh console` command hung without any response. This issue also happened when I used virsh console after I shut down and later started the VM. Even the VM was already started, I cannot return to the VM console by `virsh console`. I can get the VM console in Virt Viewer at the first boot (using virt-install). But, if I shutdown the VM once, I can never access the VM console by virsh console even the VM state is running. Any idea about how to use virsh console? Thanks, Yifei
Daniel Romero
2021-Nov-16 01:28 UTC
Cannot access KVM using virsh console after KVM rebooted or shut off
Hi, Try to enable vnc on your vm, then try to connect using that protocol and see what happens. You can use chicken of the vnc os x client to connect and be sure your host machine have the right ports open for incoming vnc connections (start at 5900). Best regards, DR Sent from my Atari 800 XL> On 15-11-2021, at 20:13, Yifei Liu <yifeliu at cs.stonybrook.edu> wrote: > > ?Dear all, > > I used ssh with -X option to connect to an Ubuntu remote server where I applied virsh > (libvirt) to manage my KVM virtual machines, and my local machine is MacOS. Then, > I used virt-install to install a Tiny Core Linux VM, and I got a pop-up Virt Viewer window > (via XQuartz) which is the console for my Tiny Core VM. However, if I rebooted my VM, > then I checked the VM state by virsh list --all which was running. Then, I tried > `virsh console my_vm_domain` but this command got stuck on: >> Connected to domain my_vm_domain >> Escape character is ^] > > The `virsh console` command hung without any response. This issue also happened when > I used virsh console after I shut down and later started the VM. Even the VM was already > started, I cannot return to the VM console by `virsh console`. > > I can get the VM console in Virt Viewer at the first boot (using virt-install). > But, if I shutdown the VM once, I can never access the VM console by virsh console even > the VM state is running. Any idea about how to use virsh console? > > Thanks, > Yifei > >
Daniel P. Berrangé
2021-Nov-16 09:27 UTC
Cannot access KVM using virsh console after KVM rebooted or shut off
On Mon, Nov 15, 2021 at 06:13:22PM -0500, Yifei Liu wrote:> Dear all, > > I used ssh with -X option to connect to an Ubuntu remote server where I applied virsh > (libvirt) to manage my KVM virtual machines, and my local machine is MacOS. Then, > I used virt-install to install a Tiny Core Linux VM, and I got a pop-up Virt Viewer window > (via XQuartz) which is the console for my Tiny Core VM. However, if I rebooted my VM, > then I checked the VM state by virsh list --all which was running. Then, I tried > `virsh console my_vm_domain` but this command got stuck on: > > Connected to domain my_vm_domain > > Escape character is ^] > > The `virsh console` command hung without any response. This issue also happened when > I used virsh console after I shut down and later started the VM. Even the VM was already > started, I cannot return to the VM console by `virsh console`.This isn't a hang, this is simply indicating that your guest OS is not running anything on the serial console. If you configure the guest to launch a login prompt on the serial port, then you'll see something on virsh console.> I can get the VM console in Virt Viewer at the first boot (using virt-install). > But, if I shutdown the VM once, I can never access the VM console by virsh console even > the VM state is running. Any idea about how to use virsh console?You're comparing two different things. Virt Viewer connects to the *graphical* console exposed by the VGA card (or whatever graphics devce is configure). virsh console connect to the primary serial port. Most OS will only display on the graphical console by default and require extra steps to activate the serial console. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|