-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
No Internet Connection inside VM / macOS m1 / 0.4.2 Nix version #344
Comments
Does starting with |
@abiosoft Unfortunately not. I still get the same errors:
Edit: If you need more help/info, I can quickly switch versions using nix and provide it. |
@aaschmid Pinging you since you use nix to install Colima as well. Do you experience the same problems? |
@tricktron are you on any slack channel, can we get to troubleshoot this interactively? Or is there a way I can simulate your VPN environment? |
I don't think so. It is a VPN using the Citrix Secure Access App to connect to one of my customers. However, I think we need to solve the issues step by step:
Is that a bug or expected?
I am not using slack anymore but if you point me to the right direction/channel I can quickly reactivate my account if it helps. |
@tricktron I have been able to reproduce the issue, it seems to be specific to Nix version. There is indeed no internet 😕 . On it! Thanks for reporting. Side Note: I know what is happening, I only do not know why it is happening on Nix. |
@abiosoft: Can I still help to reproduce? |
Have the same issue w/o any VPN. Strangely, I cannot ping any of the ip adresses from |
Not all hosts on the internet accept or respond to pings. registry-1.docker.io does not. |
You are absolutely right (I should have been more precise), Edit:
|
@tricktron do you also have a non-Nix installation of colima on your machine? |
@abiosoft
But I get the same problem without any internet connection. I have noticed that the following changed from 0.3.4 -> 0.4.1
Where should we search for the error? Do we know that it works with brew on Macos m1? |
@tricktron the issue I discovered can only be triggered by a mix of Nix and non-Nix installed versions of colima. I am just trying to ascertain if that is your scenario as well. Basically some symlinks are generated at It was an oversight from me as I mostly build and run from source. A fix will soon be out for you to test. |
@abiosoft Ah I see, your qemu wrapping here: Lines 21 to 29 in 3c03f80
does somehow interfere with nix and its symlinks. Great catch. I'll gladly help you test the fix when it is out:smiley:. |
@tricktron can you kindly build from source and try out the |
@abiosoft wow that was quick. I'll test it tomorrow. |
@abiosoft
I quickly added the qemu binary to the path and the warning disappeared. However, in both scenarios I still don't have any internet inside the vm. ls -la $HOME/.colima/_warpper/bin:
So no more qemu-* exectuables that point to colima. What is the intended dependency of qemu for colima? Should it be on the path? What about gvproxy? What is the meaning of |
@tricktron did you attempt deleting and starting afresh? Or use another profile
Thanks for pointing that out it shouldn't need to be in PATH (for Nix), I'll look at that. As for gvproxy, it is an alternate network provider for qemu.
|
Yes I have always run the following before each test run:
|
@abiosoft The created colima executable by nix is not the colima binary but the following shell wrapper file, which then calls the .colima-wrapped binary: #! /nix/store/l81df76j5jxr8lymk9zp9af94llkir94-bash-5.1-p16/bin/bash -e
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/1rpmalspdzssrh6165q0wv262vwafhdd-qemu-7.0.0/bin'':'/':'}
PATH='/nix/store/1rpmalspdzssrh6165q0wv262vwafhdd-qemu-7.0.0/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
PATH=${PATH:+':'$PATH':'}
PATH=${PATH/':''/nix/store/3ls9sgrz6sq2gx8hpmz9s5h021jhxdrg-lima-0.11.1/bin'':'/':'}
PATH='/nix/store/3ls9sgrz6sq2gx8hpmz9s5h021jhxdrg-lima-0.11.1/bin'$PATH
PATH=${PATH#':'}
PATH=${PATH%':'}
export PATH
exec -a "$0" "/nix/store/h0mv4wmk51rbm6nssadg0iinlfdmiw79-colima-0.4.2/bin/.colima-wrapped" "$@" So I think you can debug this locally if you just replace all nix-paths in this file with your local paths. You can also remove qemu or lima from the path if you want. My guess is that some env variables for gvproxy get lost on the long indirection way from nix-colima -> .colima-wrapped -> colima -> lima -> qemu. |
@tricktron thanks for this, it is quite relevant. I am still pretty new to Nix, does this mean that it is better to work off a derivation as that is the only guaranteed way to get this behaviour. Or can I achieve this in a nix-shell as well? Thanks. |
A nix derivation is a package. The nix-shell just provides you with the dependencies of the package. Developing/debugging a package needs a fork of nixpkgs. See https://nixos.wiki/wiki/Nixpkgs/Create_and_debug_packages. The result of the colima derivation is the above bash file. So you can work with that. In other words, it means that if colima works with the above bash file it works with nix. That should also means that if you replace all nix paths in the bash file with local paths, then you should be able to reproduce the no internet error. Could you try that? |
Thanks @tricktron for the heads up, I have successfully reproduced and identified the issue. Colima wraps qemu binaries to utilise gvproxy, this is done by overriding the Qemu binaries used by Lima via PATH. However, Nix overrides this behaviour with wrapped binaries and Lima will always use Nix provided Qemu binaries. There are three approaches.
|
@abiosoft I am strong believer in the golden rule of open source: push fixes upstream instead of hacking locally around them. So I would go for:
In the meantime we could have a look at:
But before getting into that discussion: Everything worked on nix in version 0.3.4. What new features in 0.4.1 need gvproxy? I see that you introduced a daemon. Daemons are not handled directly in nix with a derivation but with a nix module (handled by other projects such as nix-darwin and home-manager, which needs separate integration. So I would be perfectly fine, if there is a flag |
@tricktron can you update the Thanks as usual.
There were complaints of intermittent internet issues in previous versions and gvproxy seems to have provided a better experience. You were probably not affected.
Yeah, this is being looked at as well. Not the flag per se but a fallback mechanism. |
@abiosoft Direct access to the I created two prs in nixpkgs to fix this:
I also want to use the new Makefile in the pr. Could you create a new tag/version for it so that I can use it? @aaschmid Could you help reviewing the prs in nixpkgs? |
Yeah, I would still like to merge in the Thanks for the ride, I think I learnt a bit more about Nix thanks to this issue. |
@abiosoft Sure, go for it👍🏼 |
* chore: move CGO_ENABLE arg to makefile * chore: use actual current executable path * chore: fix generated binary on M1 mac * net: fix #344 qemu process missing gvproxy config * chore: update gitignore * chore: refactor, mock filesystem in tests * chore: update nix environment * chore: refactor Makefile (#354) * refactor: extract build logic from build.sh to Makefile * chore: add test rule to Makefile * apply review suggestion Co-authored-by: Abiola Ibrahim <git@abiosoft.com> * fix: use defined `OUTPUT_DIR` variable * chore: remove -race flag from test as it needs CGO_ENABLED=1 * chore: generate sha in binaries directory * chore: propagate Go build environment variables Co-authored-by: Abiola Ibrahim <git@abiosoft.com> * chore: disable CGO * chore: remove empty file Co-authored-by: tricktron <tgagnaux@gmail.com>
@tricktron here it is https://github.com/abiosoft/colima/releases/tag/v0.4.3. |
Also initiated the proper fix upstream. lima-vm/lima#932 |
Describe the Issue
The DNS resolver inside the Colima VM does not work and I thus have no internet connection at all.
Everything works with Colima 0.3.4 / limactl 0.11.0 / qemu 7.0.0.
Version
Colima Version:
What is the output of
colima version
0.4.2
Lima Version:
What is the output of
limactl --version
0.11.0
Qemu Version
What is the output of
qemu-img --version
7.0.0
Operating System
To Reproduce
Steps to reproduce the behavior:
docker pull node:16-alpine
-> Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 192.168.107.1:53: read udp 192.168.5.15:40660->192.168.107.1:53: i/o timeoutbad address 'google.com'
Expected behavior
DNS resolver and internet connections work.
Additional context
Edit: I use the nix package manager to install colima.
Content of /etc/resolv.conf:
nameserver 192.168.107.1
Starting Colima with
colima start --dns 1.1.1.1
solves the dns resolution problem and connections work again but VPN does not. On 0.3.4 VPN connections work perfectly.The text was updated successfully, but these errors were encountered: