Open titanous opened 3 years ago
The problem is likely the fact that minikube downloads a pre-built binary (docker-machine-driver-kvm2
), and unpatched binaries usually don't run on NixOS out-of-the-box.
$ file docker-machine-driver-kvm2
docker-machine-driver-kvm2: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, Go BuildID=2Ky3_TJwhkFqdZ3ZeXlJ/mc6R2KhI-SnHU-Ibwb6f/FCnHVcUO9u5hsmE0hjlr/2cDp9WtsFrI4hwsChrCn, BuildID[sha1]=ed7fffed63cf1d6804a8c11c373c65f18178ed45, not stripped
The binary has the interpreter set to /lib64/ld-linux-x86-64.so.2
, which does not exist under NixOS.
I imagine a true solution would be something similar to what is done for e.g. Terraform, where providers are built with Nix, rather than blobs downloaded by the tool at runtime.
You could try using patchelf
, as suggested in the wiki article, on ~/.minikube/bin/docker-machine-driver-kvm2
.
You should install pkgs.docker-machine-kvm2
, minikube will use system binary instead of download it.
Installing pkgs.docker-machine-kvm2
didn't work for me (minikube still fetching its own unpatched binary), so I manually removed ~/.minikube/bin/docker-machine-driver-kvm2
and symlinked it to /run/current-system/sw/bin/docker-machine-driver-kvm2
- system: `"x86_64-linux"`
- host os: `Linux 5.15.43, NixOS, 22.05 (Quokka), 22.05pre-git`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.8.1`
- channels(root): `""`
- nixpkgs: `/nix/store/z1lxp4xlzkigxjj9vpjnfva2vim8x1zm-source`
If using home-manager
, you could do:
home.file = {
# Patch Minikube kvm2 driver, see https://github.com/NixOS/nixpkgs/issues/115878
".minikube/bin/docker-machine-driver-kvm2".source = "${pkgs.docker-machine-kvm2}/bin/docker-machine-driver-kvm2";
};
Would it be possible to create a wrapper for this then?
Describe the bug The minikube kvm2 driver does not work at all. This appears to be due to a shared library problem that I do not know how to resolve.
To Reproduce Steps to reproduce the behavior:
minikube start --driver=kvm2 --alsologtostderr
Expected behavior The kvm2 driver should work.
Additional context
After setting
LD_LIBRARY_PATH=/nix/store/6imd0g7aw49135213pf3s6z92b7q9srz-libvirt-7.0.0/lib
it still does not work, but ldd does not complain:Notify maintainers @ebzzry @copumpkin @vdemeester @atkinschang @Chili-Man
Metadata
"x86_64-linux"
Linux 5.11.2, NixOS, 21.05pre275232.29b0d4d0b60 (Okapi)
yes
no
nix-env (Nix) 2.3.10
"nixos-21.05pre275232.29b0d4d0b60"
/nix/var/nix/profiles/per-user/root/channels/nixos