LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Redirect logs from KVM guest to KVM host (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/redirect-logs-from-kvm-guest-to-kvm-host-4175479913/)

essential1 10-07-2013 08:58 AM

Redirect logs from KVM guest to KVM host
 
It is very common to redirect system logs within networks, from one computer to another. On Linux machines we can usually do this by changing to config file of rsyslog or syslog.

I am curious about whether or not we can do this directly from a virtual machine to a host machine, but without sending any information outside the physical host machine. ie the data is sent directly to the host machine without being sent outside to a router for direction to the final address, which is how it would be done in a regular network. I also know that doing it the regular way would probably be possible, but I want to explore the possibility of doing it without the data leaving the physical machine.

I use KVM for my hypervisor. Does anybody know any way of doing this please?

acid_kewpie 10-07-2013 09:00 AM

Of course it's possible. if the host and the guest are on the same network segment, then naturally the path between them for a syslog connection will not leave the box. The is totally down to how you design your network interfaces and VM routing, but if you just appreciate the host and guest as independent systems at a network level, then implicitly if that's what your network permits, then it's possible. Try NOT to look at this as ANYTHING to do with virtualization whatsoever and it'll probably look much easier and more straight forward to you.

dt64 10-08-2013 03:29 PM

It depends on your setup of your VM's NICs.
In you decide to connect your host's NIC directly to the VM it may be the case that the routing goes outside or not, there are more dependencies kicking in.
If you assign a virtual NIC to your VM and connect it to a virtual bridge running on your host with the right settings, your traffic between your host and guest will never leave the hardware machine.
To answer more specific we would need to see your host's and VM's network setup.


All times are GMT -5. The time now is 01:30 PM.