KVM - Access guest-file in host

  • Hello everyone,


    I'm running Home Assistant in a VM with the KVM-plugin.
    In order to have fail2ban working for that VM I need it to have access to a specific file inside the VM (homeassistant.log).

    How do I get that file into my host (OMV)??


    Thanks for your help

    • Official Post

    How do I get that file into my host (OMV)??

    Since HA is a VM, fail2ban can't ban anything on the guest even if it has access to the log. You will need to run fail2ban on the guest. I'm curious why you want that though? I would not expose HA directly to the internet. I would VPN in to your network if you want to access HA remotely.

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.3 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hello everyone,


    I'm running Home Assistant in a VM with the KVM-plugin.
    In order to have fail2ban working for that VM I need it to have access to a specific file inside the VM (homeassistant.log).

    How do I get that file into my host (OMV)??


    Thanks for your help

    Hi, can you explain to me how exactly you got HA to run in KVM? I fail at creating the network...

    • Official Post

    Hi, can you explain to me how exactly you got HA to run in KVM? I fail at creating the network...

    Did you read this? https://wiki.omv-extras.org/do…?id=omv7:omv7_plugins:kvm

    omv 8.5.8-1 synchrony | 7.0 proxmox kernel

    plugins:

    omvextrasorg 8.0.3 | kvm 8.3.2 | compose 8.1.24 | cterm 8.0.3 | borgbackup 8.2.1 | tempmon 8.0.5 |

    mergerfs 8.0.2 | scripts 8.0.6 | writecache 8.2.4 | backup 8.1 | kernel 8.0.16


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    Hi, can you explain to me how exactly you got HA to run in KVM? I fail at creating the network...

    and this (note the screenshot) ...


  • macom and ryecoaaron Thank you so much.


    I didn't dare to change these network settings the whole time because I was worried about losing the connection to the server afterwards. But what can I say, it worked. I have just started the ISO for HA under KVM and it worked.


    But now I have to figure out how to integrate my Zigbee USB stick into the VM and how to make HA (securely) accessible from the outside

    :D


    Correction: The passtrough the USB Dongle was very easy. Under OMV7 there is an extra button at the KVM dashboard :)

  • Sorry, I was away for a longer time.

    Thanks ryecoaaron for your clarification regarding fail2ban. Of course, it makes total sense now.

    lev: My system has two physical NICs, eth0 and eth1. I created a bridge (br0) with the the second one (eth1) in OMV's network>interfaces secton and assigned that one to the VM in the KVM plugin (with virtio).
    I believe this is the relevant part of the final xml:

    Code
    <interface type='bridge'>
          <mac address='5xxxxx:xxx:xxx'/>
          <source bridge='br0'/>
          <target dev='vnet0'/>
          <model type='virtio'/>
          <alias name='net0'/>
          <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
        </interface>


    Hope this is still helpful for you.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!