Open sanyer opened 2 years ago
@n1hility PTAL
A friendly reminder that this issue had no activity for 30 days.
This feature request sounds like a good idea. I have it on my eventual todo but if anyone wants to take a stab at contributing this is a nice first time feature. Feel free to ping me on the issue for help if you are interested.
@n1hility I think I can actually help with it :-)
Ok great! The init command impl you need to add the parameter to is here: https://github.com/containers/podman/blob/main/cmd/podman/machine/init.go
The backend you need to pass it to and use during import is here:
https://github.com/containers/podman/blob/main/pkg/machine/wsl/machine.go
To build it’s easiest if you do so on a linux env. You can do make podman-remote-windows and copy over the podman.exe
Perfect, thanks! Btw, I'm using docker to build podman, not on linux per se.
A friendly reminder that this issue had no activity for 30 days.
Good reminder, I'll try to get back to this issue coming week.
A friendly reminder that this issue had no activity for 30 days.
@sanyer any update.
@rhatdan I've made progress locally, will PR this weekend.
A friendly reminder that this issue had no activity for 30 days.
@sanyer Are you still working on this?
Hey @rhatdan , yes! Coming back to it after a break.
Great
@sanyer did you ever get a chance to look at a patch?
@n1hility yes, I did. Did even some test builds but got overwhelmed at some point and decided to move it to "better times". What would you say if I push whatever I did to a PR, describe my struggles and get some tips?
@sanyer, that sounds great. Feel free to open a PR.
does this feature work? I just tried to migrate my podman 20G vhdx file into new laptop but failed.
hey @delicacyyy , no, not yet. I don't have enough capacity to find time for this yet. But it is on my list. But I definitely was able to migrate my podman vhdx file. You can try using my gist: https://gist.github.com/sanyer/0d25dbf8e57faaa7358c46cfb746da82
If it's simply to change where the vhdx file is initialized, I recently found a workaround by setting XDG_DATA_HOME as an environment variable.
It also changes where images are stored, as documented, but it works pretty well for me since I'm running a smaller boot drive and a much larger SSD.
I also is able to relocate WSL 2 image location by wsl
utility:
cd d:/srv/wsl
mkdir podman-machine-default
wsl --shutdown
wsl --export podman-machine-default podman.tar
wsl --unregister podman-machine-default
wsl --import podman-machine-default podman-machine-default/ podman.tar --version 2
del podman.tar
I use lots of tools so I'm afraid of XDG_DATA_HOME
- some might use it with unpredictable effect (like Cygwin or MSYS)...
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
Steps to reproduce the issue:
Describe the results you received:
ext4.vhdx file of a wsl distribution is created in %HOME%.local\share\containers\podman\machine\wsl\wsldist
Describe the results you expected:
Using something like
--wsl-distro-path
to specify destionation of wsl diskAdditional information you deem important (e.g. issue happens only occasionally):
I was able to relocate distribution by running these commands:
So, it works fine in other location.
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.):