-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman machine start fails on Mac M1(osx 12.4) (podman 4.1.1, qemu 7.0) #14837
Comments
Did you try to remove the machine and create a new? @ashley-cui @baude PTAL |
Thanks @Luap99 , I remove machine and create a new one everytime I use podman. BTW I also don't mind waiting for a fix until next release. because I work around by deleting and recreating VM. Can you please tell me how to use podman from main branch. is there special brew command or Do I have to build from source.? is it |
brew install podman --HEAD should work |
currently it gives;
Nevermind;
and removing the patch fixes the install procedure. But the main issue remains |
So I tried installing Podman from Main
Then I did as he sugested
after that install went ok.
but Issues still remained. I had also cleaned previous machine using when I
With Debug
|
Hi, @kp2401075! I have exactly same M1 2020 Macbook Air. And the next steps make my podman work: First, initialized the machine with
then i've changed memory to desired value in
After this i've successfully started my podman machine with Hope it woudl help! |
Lot of readings could be found here Also, there's a dirty hack with experimental build of podman https://edofic.com/posts/2021-09-12-podman-m1-amd64/ |
Hello @iamthen0ise, |
#14850 was just merged, if you rebuild from main it should return a proper qemu error message (assuming qemu fails). |
Thanks @Luap99 , I re-installed podman with I've deleted & recreated podman machine and stop and then start multiple times. Error message remains as below.
I believe it is reffering to the {
"ConfigPath": {
"Path": "/Users/jaypatel/.config/containers/podman/machine/qemu/podman-machine-default.json"
},
"CmdLine": [
"/opt/homebrew/bin/qemu-system-aarch64",
"-m",
"2048",
"-smp",
"1",
"-fw_cfg",
"name=opt/com.coreos/config,file=/Users/jaypatel/.config/containers/podman/machine/qemu/podman-machine-default.ign",
"-qmp",
"unix://var/folders/k9/12cdgrpn4bl5ybl800vww62w0000gq/T/podman/qmp_podman-machine-default.sock,server=on,wait=off",
"-netdev",
"socket,id=vlan,fd=3",
"-device",
"virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee",
"-device",
"virtio-serial",
"-chardev",
"socket,path=/var/folders/k9/12cdgrpn4bl5ybl800vww62w0000gq/T/podman/podman-machine-default_ready.sock,server=on,wait=off,id=apodman-machine-default_ready",
"-device",
"virtserialport,chardev=apodman-machine-default_ready,name=org.fedoraproject.port.0",
"-pidfile",
"/var/folders/k9/12cdgrpn4bl5ybl800vww62w0000gq/T/podman/podman-machine-default_vm.pid",
"-accel",
"hvf",
"-accel",
"tcg",
"-cpu",
"host",
"-M",
"virt,highmem=on",
"-drive",
"file=/opt/homebrew/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on",
"-drive",
"file=/Users/jaypatel/.local/share/containers/podman/machine/qemu/podman-machine-default_ovmf_vars.fd,if=pflash,format=raw",
"-virtfs",
"local,path=/Users/jaypatel,mount_tag=vol0,security_model=mapped-xattr",
"-drive",
"if=virtio,file=/Users/jaypatel/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-36.20220703.2.1-qemu.aarch64.qcow2",
"-fw_cfg",
"name=opt/com.coreos/environment,string=c29tZSBDb3Jwb3JhdGUgcHJveHkK",
"-fw_cfg",
"name=opt/com.coreos/environment,string=c29tZSBDb3Jwb3JhdGUgcHJveHkK",
"-fw_cfg",
"name=opt/com.coreos/environment,string=c29tZSBDb3Jwb3JhdGUgcHJveHkK"
],
"Rootful": false,
"UID": 503,
"IgnitionFilePath": {
"Path": "/Users/jaypatel/.config/containers/podman/machine/qemu/podman-machine-default.ign"
},
"ImageStream": "testing",
"ImagePath": {
"Path": "/Users/jaypatel/.local/share/containers/podman/machine/qemu/podman-machine-default_fedora-coreos-36.20220703.2.1-qemu.aarch64.qcow2"
},
"Mounts": [
{
"ReadOnly": false,
"Source": "/Users/jaypatel",
"Tag": "vol0",
"Target": "/Users/jaypatel",
"Type": "9p"
}
],
"Name": "podman-machine-default",
"PidFilePath": {
"Path": "/var/folders/k9/12cdgrpn4bl5ybl800vww62w0000gq/T/podman/podman-machine-default_proxy.pid"
},
"VMPidFilePath": {
"Path": "/var/folders/k9/12cdgrpn4bl5ybl800vww62w0000gq/T/podman/podman-machine-default_vm.pid"
},
"QMPMonitor": {
"Address": {
"Path": "/var/folders/k9/12cdgrpn4bl5ybl800vww62w0000gq/T/podman/qmp_podman-machine-default.sock"
},
"Network": "unix",
"Timeout": 2000000000
},
"ReadySocket": {
"Path": "/var/folders/k9/12cdgrpn4bl5ybl800vww62w0000gq/T/podman/podman-machine-default_ready.sock"
},
"CPUs": 1,
"DiskSize": 100,
"Memory": 2048,
"IdentityPath": "/Users/jaypatel/.ssh/podman-machine-default",
"Port": 61045,
"RemoteUsername": "core",
"Starting": false,
"Created": "2022-07-10T13:26:31.722565+10:00",
"LastUp": "2022-07-10T13:27:23.163821+10:00"
} I see there are some duplicate entries in the "CmdLine" array at the end section. Funny thing is I've tried removing the duplicate entries and tried starting it. it adds them when I execute Possible Solution.If I remove all the entries starting with
But another entry gets added after machine start. Me not being familiar with codebase can't figureout the issue but i believe it could be in func (p *Provider) LoadVMByName(name string) (machine.VM, error) {
vm := &MachineVM{Name: name}
vm.HostUser = machine.HostUser{UID: -1} // posix reserves -1, so use it to signify undefined
if err := vm.update(); err != nil {
return nil, err
}
// It is here for providing the ability to propagate
// proxy settings (e.g. HTTP_PROXY and others) on a start
// and avoid a need of re-creating/re-initiating a VM
if proxyOpts := machine.GetProxyVariables(); len(proxyOpts) > 0 {
proxyStr := "name=opt/com.coreos/environment,string="
var proxies string
for k, v := range proxyOpts {
proxies = fmt.Sprintf("%s%s=\"%s\"|", proxies, k, v)
}
proxyStr = fmt.Sprintf("%s%s", proxyStr, base64.StdEncoding.EncodeToString([]byte(proxies)))
vm.CmdLine = append(vm.CmdLine, "-fw_cfg", proxyStr) <<<<<<<<<<<< MAY BE HERE <<<<<<<<<<<
}
logrus.Debug(vm.CmdLine)
return vm, nil
} Reason Why I looked at proxy related thing is because Function |
I think your analyses is correct, it should replace the proxy option and not append. |
qemu fails when the same `fw_cfg` options is used more than once. Since the current logic always adds a new option on each machine load this will fail on the second start. We can fix this by checking if the option is already set and replace but I think it is easier to just not commit the option in the config and add it dynamically on start. User that hit this bug have to recreate the machine. [NO NEW TESTS NEEDED] Fixes containers#14636 Fixes containers#14837 Signed-off-by: Paul Holzinger <[email protected]>
Is this issue fixed? I have encountered the same issue today morning when my mac recovered from sleep. (base) fulwang@MacPro ~ % podman machine list qemu: stable 7.0.0 (bottled), HEAD |
and seems i have the same issue with @kp2401075 in the json file, duplicate entries in the "CmdLine". another thing is when system restore from sleep i must manually stop the machine and restart again to gain the correct timing, or else when you making update in container such as apt update in Ubuntu, you would probably encounter "Repository is not valid yet" error. (base) fulwang@MacPro ~ % cat ~/.config/containers/podman/machine/qemu/podman-machine-default.json |
qemu fails when the same `fw_cfg` options is used more than once. Since the current logic always adds a new option on each machine load this will fail on the second start. We can fix this by checking if the option is already set and replace but I think it is easier to just not commit the option in the config and add it dynamically on start. User that hit this bug have to recreate the machine. [NO NEW TESTS NEEDED] Fixes containers#14636 Fixes containers#14837 Signed-off-by: Paul Holzinger <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Podman machine start fails.
** Log-Level = Debug **
Steps to reproduce the issue:
podman machine init
podman machine stop
podman machine start
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):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
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: