linux isnt immune to viruses even though its not as bad as windows

what should i do to be safe if i have a safe browser, vm, but pirate and download risky things? i know its a vm but i still dont want to have to delete everything in the vm if something happens. also the malware doesnt go to the router and spread rigt???

  • hirihit640@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    2 days ago

    very rare for exploits that can breach a VM. Like once-every-10-years kind of rare.

    One important thing to be aware of. By default your VM will have access to the same network resources as the host. So, say, if you use tailscale or some other secure VPN to protect your NAS, but you give your host access, the VM will be able to access it too! You can use firewall rules or bridge networking to fix this, but tbh it isn’t trivial.

    • nyan@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      Depends on your VM. qemu, by default, isolates each VM on a subnet. It’s a PITA when you actually need the VM to be able to see the LAN.

      • hirihit640@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        23 hours ago

        It’s been a while since I’ve tested the defaults, but if your VM has internet access it would also have access to the LAN right? From the perspective of the VM it’s all the same, just sending requests to the router. Unless QEMU specifically blocks requests to LAN network ranges.

        • nyan@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          11 hours ago

          I’m not sure what the mechanism is, but I discovered the issue by empirical testing a few months ago, and I’m still trying to sort it out and make the LAN visible to that VM. Granted, I haven’t been able to put much time into it, but I keep ending up down among the weeds of iptables/nftables, with all the documentation either out of date or not intended for a host using netifrc for network management (or both). I’ll probably have to ask on the Gentoo boards eventually.