I occasionally find myself reinstalling home assistant and every time I do, I get stuck on two steps because I forgot the commands and didn’t write them down from the last time. I’m writing them below mainly for myself but also for anyone else who may get stuck. For future reference, I’m using Ubuntu 23.04 with Virt-Manager.

Before you begin the installation of the provided qcow2 image, you might want to resize that image from 32G to whatever size you want. ex:

qemu-img resize haos_ova-10.3.qcow2 +68G

Next, you might want to make a network bridge device. Navigate to your netplan folder and backup the yaml file that’s in there (your file may be named differently)

cd /etc/netplan

cp ./01-network-manager-all.yaml ./01-network-manager-all.yaml.old

Edit the yaml config.

nano ./01-network-manager-all.yaml

Change the renderer to networkd and add the bridge device (br0). Your ethernet device may not be named enp12s0, make sure to use your ethernet device name. If you are on wifi, look up a netplan wifi config and make adjustments as needed.

network:
  renderer: networkd
  ethernets:
    enp12s0:
      dhcp4: true
  version: 2
  bridges:
    br0:
      dhcp4: yes
      interfaces:
        - enp12s0
      parameters:
        stp: true

save the file. generate and apply the new netplan. WARNING - If you are hosting this on your own network, it’s possible the Ubuntu host IP could change. If you were doing these steps over SSH, you might need to find the new IP and reconnect. Static IPs can be set in the netplan config but I usually just do it from my router settings afterwards which is probably why the IP changed.

netplan generate

netplan apply

Now just go through the installation process and when you select your network device, make sure you select “Bridge Device” and the device name is “br0”

Edit 12/15/23 - well, I rebuilt my server again. I used regular Ubuntu desktop this time and I for the life of me I couldn’t get networking to function properly. I ended up buying an Ethernet card and passed it through to the VM

  • thereddevil@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Thanks for listing it down. I’ve had to occasionally resize my disk for my vm.

    If I may ask, why are you reinstalling HA occasionally? I’ve had the same install running for 5 years and the only time I had to re install was when I moved from a Pi to a mini PC

    • a_fancy_kiwi@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      1 year ago

      I can’t seem to just let my self-hosted services sit and work. I’m always tearing them down, rebuilding them, moving them to different machines for various reasons, trying new installation methods and comparing features (ex. docker vs. VM vs. bare metal), trying new file systems, etc. Home Assistant itself is solid and I’ve never had to reinstall due to something breaking.

  • krimson@feddit.nl
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Why not use docker? Saves a lot of hassle and you can easily transfer your docker compose file and HA configuration to another machine if needed.

    • PupBiru@kbin.social
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      docker is a PITA for HASS… theres some non-trivial networking to get right so that mDNS works correctly, and my HASS homekit bridge kept dropping off for unknown reasons until i moved out of docker

      physical or VM is just much easier and more reliable in this case

    • SteWi@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      I started out with docker because it looked like a clean and portable solution.

      After adding container after container to get the features/add-ons i wanted, various hassles with USB components and networking troubles I ended up with a solution that was a PITA to keep updated.

      Then I switched to a RPi and it was smooth sailing (especially integrated updates and backup).

      Next step is to move it to proymox running on an Odroid H3…

    • a_fancy_kiwi@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Like the other person said, more features.

      Also, I don’t really understand Docker. Like, why use it over Flatpak, Snap, or LXC? I really need to research more but just haven’t done it yet