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

Cannot resolve mirrors.fedoraproject.org Windows machine init #13700

Closed
AddictArts opened this issue Mar 29, 2022 · 17 comments
Closed

Cannot resolve mirrors.fedoraproject.org Windows machine init #13700

AddictArts opened this issue Mar 29, 2022 · 17 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine windows issue/bug on Windows

Comments

@AddictArts
Copy link

BUG REPORT

/kind bug

Windows podman machine init after podman-4.0.2.msi install has an error. " - Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-35&arch=x86_64".

Steps to reproduce the issue:

  1. Install WSL2

  2. Install podman-4.0.2.msi

  3. Run podman machine init using the Command Prompt.

C:>podman machine init
Extracting compressed file
Importing operating system into WSL (this may take 5+ minutes on a new WSL install)...
Installing packages (this will take awhile)...
Failed to set locale, defaulting to C.UTF-8
Fedora 35 - x86_64 0.0 B/s | 0 B 02:00
Errors during downloading metadata for repository 'fedora':

Expected it to run without error.

I was connected to the internet and able to resolve curl 1.1.1.1 along with mirrors.fedoraproject.org in a web browser.

>podman version
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: Get "http://d/v4.0.2/libpod/_ping": dial unix ///run/podman/podman.sock: connect: An invalid argument was supplied.

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Windows 10 latest stable updated
WSL2

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 29, 2022
@Luap99 Luap99 added windows issue/bug on Windows machine labels Mar 29, 2022
@Luap99
Copy link
Member

Luap99 commented Mar 29, 2022

Can you ssh into the vm with podman machine ssh?

@n1hility PTAL

@AddictArts
Copy link
Author

@Luap99 unfortunately no since the machine is never started and failed init.

C:>podman machine start
Starting machine "podman-machine-default"
/bin/bash: line 1: /root/bootstrap: No such file or directory
Error: WSL bootstrap script failed: exit status 127

C:>podman machine ssh
Error: vm "podman-machine-default" is not running.

@n1hility
Copy link
Member

@AddictArts is this issue transient? what happens if you podman machine rm and then podman machine init? If you have wsl already installed as your instructions indicate, are you able to reach remote sites from within the stock wsl instance (e.g run “wsl” then after getting a bash promt does curl resolve remote addresses)?

btw I’m away this week with limited availability so will unfortunately be very delayed in replying.

@AddictArts
Copy link
Author

AddictArts commented Mar 29, 2022

@n1hility Thanks for asking. No it is not transient. I did try those steps and I get the same results. Inside WSL2 and Ubuntu instance I am able to access remote sites.

Mirrors.fedoraproject.org is a redirect, which I can curl from wsl2. This machine though tends to use ipv6, or at least I have had to use ::1 for example as 127.0.0.1 would not work, nor would localhost. Just pointing this out on the off chance it is ipv6 related. Ignore if otherwise.

~$ curl mirrors.fedoraproject.org
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://mirrors.fedoraproject.org/publiclist/">here</a>.</p>
<hr>
<address>Apache Server at mirrors.fedoraproject.org Port 80</address>
</body></html>

@n1hility
Copy link
Member

n1hility commented Apr 8, 2022

@AddictArts it could very well be ipv6 related. Can you run the same test on the wsl instance that podman created?

So basically after machine init fails do:
wsl -d podman-machine-default

then do
curl -v --head mirrors.fedoraproject.org

Whats the output look like?

Could you also cat /etc/resolv.conf?

Thanks!

@AddictArts
Copy link
Author

The @n1hility Oddly today I tried again from the top with podman machine init and viola, it downloaded and did the complete init. I could also start the machine. So, whatever was wrong with the lookup of the mirror got resolved.

Now I get this, but it seems like I can ignore it, different issue, tmp issue

C:\>podman ps
time="2022-04-08T18:20:13-07:00" level=warning msg="Failed to retrieve default tmp dir: invalid image_copy_tmp_dir value \"/var/tmp\" (relative paths are not accepted)"
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES

@n1hility
Copy link
Member

n1hility commented Apr 9, 2022

@AddictArts ah glad to hear it’s working now. The bogus warning you mentioned was recently fixed, and will be in the next release:

containers/common#951

If it bothers you, you should be able to edit your containers conf and manually set it to the windows temp folder

@n1hility n1hility closed this as completed Apr 9, 2022
@AddictArts
Copy link
Author

AddictArts commented Apr 12, 2022

Thanks @n1hility

I tried a number of ways to set that image_copy_tmp_dir, edited the podman-machine-default.json, but no luck there. I created a containers.conf in .config/containers with

[engine]
image_copy_tmp_dir=C:\\<PATH TO MY LOCAL TEMP>

That didn''t work.

Then I saw that the go code looks at TMPDIR, so I used

set TMPDIR=%TEMP%

And that eliminated the warning message.

@n1hility
Copy link
Member

n1hility commented Apr 12, 2022

@AddictArts Sorry I should have mentioned: The containers.conf is in a slightly different location on Win, under %AppData%/containers It should already exist and contain your connection info, but you would have to add that section like you did in your sample. That's probably why it wasn't taking effect.

@panoc1
Copy link

panoc1 commented Jun 22, 2022

Hi! Happening the same here but for 4.1.1.msi installation.

When I try podman machine init I'm getting the following:

Extracting compressed file
Importing operating system into WSL (this may take 5+ minutes on a new WSL install)...
Installing packages (this will take awhile)...
Failed to set locale, defaulting to C.UTF-8
Fedora 35 - x86_64                                                                                                                                                                                           0.0  B/s |   0  B     02:00
Errors during downloading metadata for repository 'fedora':
  - Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-35&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]
Error: Failed to download metadata for repo 'fedora': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-35&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]
Error: package upgrade on guest OS failed: exit status 1

As suggested, I tried with the following outputs:

  1. curl -v --head mirrors.fedoraproject.org
* Could not resolve host: mirrors.fedoraproject.org
* Closing connection 0
curl: (6) Could not resolve host: mirrors.fedoraproject.org
  1. cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.31.224.1

Any suggestions?
Thanks in advance

@panoc1
Copy link

panoc1 commented Jun 22, 2022

Ok so avoid previous comment. I figured out the problem has to do with wsl version 2. I made the downgrade to version 1 and connection to internet seems to work fine.

Keeping all this info for the record, just in case someone comes with the same problem as me

@artyredd
Copy link

artyredd commented Jul 9, 2022

WSL 2 was confirmed the issue for myself as well

The following commands should get it to work

podman machine rm
y
wsl --set-default-version 1
podman machine init

@n1hility
Copy link
Member

n1hility commented Jul 9, 2022

You should only ever use WSL2 with podman (Wsl 1 is very likely to lead to problems since it does not implement all Linux system calls (it’s also deprecated))

@rhatdan
Copy link
Member

rhatdan commented Jul 9, 2022

@n1hility is there anyway podman could detect that it is running on WSL1, and fail with a decent error message?

@n1hility
Copy link
Member

n1hility commented Jul 9, 2022

@rhatdan yes we should be able to override and prevent it on on init and fail on start if it was changed afterwords. I’ll put a PR together.

@sandichhuu
Copy link

I facing the same problem.
Run with WSL1 is fine.

@PennRobotics
Copy link

PennRobotics commented Jul 25, 2022

@Luap99 unfortunately no since the machine is never started and failed init.

C:>podman machine start
Starting machine "podman-machine-default"
/bin/bash: line 1: /root/bootstrap: No such file or directory
Error: WSL bootstrap script failed: exit status 127

C:>podman machine ssh
Error: vm "podman-machine-default" is not running.

I had the same error but resolved it (while still using WSL2) by trying the 4.2 prerelease

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine windows issue/bug on Windows
Projects
None yet
Development

No branches or pull requests

8 participants