Sithuk / ubuntu-server-zfsbootmenu

Ubuntu zfsbootmenu install script
123 stars 28 forks source link

Connecting to wifi in postinstall #21

Closed mcamou closed 1 year ago

mcamou commented 1 year ago

How do I connect to WiFi after rebooting to do the postinstall? I am installing Kubuntu, but it seems that NetworkManager is installed/configured only after installing the distro, and I need WiFi to install the distro itself.

Sithuk commented 1 year ago

You shouldn't need wifi to carry out the postreboot install part of the script. The ethernet connection should work fine. As you note, wifi isn't setup at that stage. Please can you test to confirm?

mcamou commented 1 year ago

My issue is that I don't have Ethernet on my laptop at the moment, my only connection to the internet is via WiFi. Any ideas?

mcamou commented 1 year ago

Now that I think about it, would it be possible to run postreboot in a chroot while still in the live CD environment? I assume that that is how most distros do it.

Sithuk commented 1 year ago

You could edit the netplan config file created in the initial part of the script to add your wifi details prior to the reboot. Or edit the script to include the details. Then the wifi should be present post reboot.

The config file is in /etc/netplan of your chroot environment. You could try editing the file to reflect the following. Remember that yaml config files are sensitive to the number of spaces of each indent. You'll need to replace the variable names with your actual interface name, wifi name and wifi password. You might need to do additional steps but hopefully this is enough to point you in the right direction. Run "netplan apply" in the chroot environment after you edit the yaml file to apply the configuration.

network:
  version: 2
  ethernets:
    $ethernetinterface:
      dhcp4: yes
  wifis:
    $wifiinterface:
      dhcp4: yes
      access-points:
        "$nameofwifi":
          password: "$wifipassword"
Sithuk commented 1 year ago

Or you could try to install NetworkManager in a chroot environment after the intial part of the script is complete, but prior to the first reboot.

mcamou commented 1 year ago

Just FYI, I did as I suggested and ran postreboot in a chroot. Everything seems to have worked well, the system booted and all works as expected. It might be a good idea to do a single-step process, everything in the live CD environment, I'm not sure what the downsides would be.

BTW, this is a great project!

Sithuk commented 1 year ago

The initial approach to the script was to follow rlaager's zfs on root guide on the Openzfs Documentation website (linked in the readme). Rlaager splits the install procedure across a reboot. Please let me know if you experience any issues with your install.

mcamou commented 1 year ago

Everything is still working fine, I haven't noticed any issues (which doesn't mean that there aren't any, just that I haven't noticed them). It might be a good idea to add an experimental option to run the second phase in a live CD environment chroot.

Sithuk commented 1 year ago

Hi mcamou, I've revised the script to carry out the installation in a single step from the live CD environment. There is no longer a need to reboot to continue the installation. Are you able to test the revised script and let me know if it works for you?

mcamou commented 1 year ago

Hi Sithuk, I unfortunately don't have a box where I can test it ATM. I did the previous installation in my main work laptop.

Sithuk commented 1 year ago

No problem. Maybe next time.