Is there anyway that I can ssh into a guest vm through virsh instead of find the ip address of the guest vm?
e.g.
what I want is ssh into a guest like this way :
$virsh ssh_or_somwthing <domain>but not like this:
$ #1) find the guest vm's IP address:
$arp
...
$ #2) ssh someone@<IP> 3 Answers
Jacek has the right answer, but just to lay out some of the specifics:
- Log into the VM using the KVM GUI
On the VM command line, type in:
systemctl enable systemctl start
You will be asked multiple times to enter your password/accept.
- Reboot the VM
Then, from the terminal on your main machine, type in:
sudo virsh console your_vm_name_here
Obviously replacing "your_vm_name_here" with whatever the VM name is.
Then you can "ssh" directly into the VM using virsh.
I'm not sure about it, but I think you're looking to configure console access to the guest? It may not be the only solution (not following virsh very actively and all this stuff) - but you can setup serial console on your guest, configure your supervisor and then use virsh console domain.
Anyway - have a look at this: - I guess it may help or at least put you in some direction.
2You may want to take a read of SSHsetup for libvirtd
Seems to do what you want.
1