Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy to use installation #75

Open
nirs opened this issue Nov 16, 2024 · 0 comments
Open

Easy to use installation #75

nirs opened this issue Nov 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nirs
Copy link
Member

nirs commented Nov 16, 2024

Continuing discussion in #lima slack:
https://cloud-native.slack.com/archives/C043N6ZFV9S/p1731620681024829

We want to create easy to use installer that works for everyone and is secure by default.

The current way to install is downloading the tarball and extracting it to the safe directory (writable only by root). This is easy to get wrong by using /usr/local or installing in your home directory as unprivileged user. It is also easy to install in a safe non-default location that requires additional configuration in related application like lima.

The next step is adding a launchd service, which is much harder on macOS compared to Linux. There are legacy and new ways to add an start a service, that seem to work or do nothing. This user experience is very poor.

To use bridged network, you need to modify the the launchd configuration to include the interface name.

Installer package

Provide a standard installer package (e.g. socket_vmnet-x.y.z-aarch64.pkg) in the github release page. The package can be installed using the Installer.app application (e.g. open socket_vmnet-x.y.z-aarch64.pkg) or using automated installation using the installer command.

The installer will install socket_vmnet to the default location /opt/socket_vmmnet, enforcing the correct permissions on the install directory (the recommended default).

The installer package can be created using pkgbuild:

pkgbuild --root ./_artifacts/{arch} --identifier io.github.lima-vm.socket_vmnet socket_vmnet-{version}-{arch}.pkg

The only documentation seems to be pkgbuild(1).

Adding and removing launchd service

The socket_vment executable will provide sub command to install and remove the launchd service:

socket_vmnet --install-service [--bridged=INTERFACE] [--service-plist=FILE]

The install command will install the plist file, replacing the INTERFACE name for bridged mode, and start or restart the service.

To use non default options user can copy the default plist files and use --service-plist=my-service.plist.

socket_vmnet --remove-service [--bridged=INTERFACE]

The remove command will stop and remove the service installed by the install command.

Documentation

When we have a downloadable pkg file, we can replace the binary installation instructions with instructions for the pkg file.

  • Using the Installer.app - open the pkg file an follow the installer pages
  • Using the installer command - show the commands to install the pkg

Testing

We can build the pkg and install it using the installer command in the tests.

We need to test:

  • new install
  • upgrading from previous version
    • install latest release pkg, and upgrading to the pkg build from current master
  • install and start the launchd service
  • stop and remove the launchd service
  • should be tested on all supported macos version

Install tests are very quick and does not require much resources, can run on all standard macos runners

See also

@nirs nirs added the enhancement New feature or request label Nov 20, 2024
@AkihiroSuda AkihiroSuda pinned this issue Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant