-
Notifications
You must be signed in to change notification settings - Fork 308
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
Update Lima to latest so we can try Virtiofs #3488
Comments
@jandubois in the meantime is there a way we can get rancher desktop to use a newer version of lima manually? Like copying the latest lima binary to where it is embedded in the rancher desktop install location? |
I will be looking into this in the next few weeks and see if I can provide a replacement tarball that you can use for testing; not sure if it will require a new ISO as well, or not. If you follow Lima development, you will have noticed that this is still the bleeding edge, and problems continue to be discovered, so it does not seem to be ready for real usage. I will try to find a way how this can be bundled and enabled on an experimental opt-in basis for the next release, but can't promise yet, if this will be possible. |
Just one example of the issues we need to resolve: the VZ code only works if it has been built on a Ventura machine with the latest XCode. However, that very likely means that the code will not work correctly on older macOS releases. So maybe we need to build multiple instances of Lima, and choose at runtime which version to use. We still need to support at least Big Sur and Monterey in addition to Ventura (we will drop support for Catalina though, as it is now completely unsupported by Apple). |
That is a challenge. It looks like And the oldest macOS version that can be used with xcode 14.1 is Monterey 12.5 or later.
If you want to build VZ support (Without supporting multiple builds of lima) you could only support Monterey or newer. Big Sur won't be end of life until 12, Nov, 2023. It looks like a challenge to support older macOS's and all the features lima is coming out with (VZ). That does put a burden on Rancher Desktop. Does Rancher Desktop try to support all the new features in lima by dropping support for older macOS versions or try to support all non-end of life macOS versions even though lima may not. Our perspective is we are eager to get our hands on the newest improvements in lima. Looking at some other projects similar to Rancher Desktop... Colima does not bundle lima it depends on lima via the brew formula. So Colima supports what lima supports. Finch builds lima on macOS 10.15 for amd64 and macOS 11.11 for arm64. I am willing to help figure out solution for this and work on some tickets. Not sure if it is wanted or not, just let me know how I can get involved. |
I noticed. I just did a test build with lima 0.14.2 and the macOS 13 SDK: https://github.com/rancher-sandbox/lima-and-qemu/actions/runs/3859700464 I will now test this manually, but I only have Catalina and Monterey Intel Macs anymore, so cannot test the VZ bits right now. Will have to do an ARM build manually to test on Ventura.
I'm not opposed to doing multiple builds to support all platforms; it will just take some extra effort. Let's first find out if it is necessary.
Lima does support older macOS versions too; it just builds without VZ support on them: This works fine for Lima because e.g. Homebrew has separate bottles for Big Sur, Monterey, and Ventura. We only want to have a single build of RD for macOS (well, one for Intel and one for ARM, at least for now), so we may have to bundle multiple versions and decide at runtime which one to use. We'll see. But we definitely want to support all macOS versions that are not yet EOL'ed by Apple.
It does. But if you observed it closely, you can see that colima ran into various issues during the last few weeks and had to back out some changes to make it work again. If you look closely, you'll notice that I fixed one of the issues for them: lima-vm/lima#1243 We try to avoid this instability by waiting until things have settled down a bit, which I hope they have by now (not completely, but maybe good enough for experimental support).
Finch is using the "lima-and-qemu" packaging mechanism from Rancher Desktop.
Yes, your help is very much appreciated! I'm trying to get at least the I'll update here when I have some testing results; please do the same if you get the chance! |
For some reason the bundled lima version is not 0.14.2, but a couple commits later; I still have to figure out how that happened. I thought the submodule was pointing the the right commit. And testing shows that we definitely need 2 versions of Lima, one for Big Sur+, and one for Ventura. I think we can still package a single version of qemu, to save some space (I know, a losing fight, but we have to try). |
I can work on the changes required in Lima-and-qemu to support it. While also updating the submodule. |
The submodule turned out to be correct after all. I ran I'm working on the changes right now: I think we can continue to build Then RD will have to be updated to fetch the additional resource and put it into But if you want to do it, that works for me too! 😄 Start with the PR for lima-and-qemu, to make the changes I described above. Upload the Once it all works and is merged, I'll create another release, and then you can work on the changes to RD itself. |
Ok, I see you made the changes in |
Yes, I would like to revert this to build the whole tarball with macOS 11 again, and then add another step to just build lima on macOS 12, and then package up just The XCode switch obviously should move to this new step. |
Ok, I'll take a stab at it today. |
@ryancurrah I've created https://github.com/rancher-sandbox/lima-and-qemu/releases/tag/v1.29 for testing (Intel assets only right now). Do you also want to work on the changes required in Rancher Desktop itself? It will essentially just be the additional download of At runtime during startup RD would then check the OS version and symlink either of the 2 binaries into the If you don't want to work on that part, please let me know, and I'll look into it probably early next week. At that time I'll also generate the ARM64 binaries for the 1.29 release. |
I can take a shot at it. |
Thanks! Let me know if you need help (or if you decide to abandon it).
I just realized that we must not make any changes inside the app directory, as that can break the signature. So instead we should have a variable in the paths package that includes the full path to the |
Ok I will look at tonight after I put the little one to bed. Will update here if/when I get stuck. |
Just looking at how it gets installed. Should I create a new class here https://github.com/rancher-sandbox/rancher-desktop/blob/main/scripts/dependencies/lima.ts#L16 called |
No, just include the download in the |
Ack thank you. |
Well, I got an initial WIP going here #3761. It will install a |
It will get installed by Note that the scripts will not download files again that already exists locally, without checking content checksums, or anything. So if you switch branches, or want to build M1 binaries after building Intel binaries, you'll have to run |
I've tested this with the latest CI build of #3761 (now merged) from https://github.com/rancher-sandbox/rancher-desktop/actions/runs/3958949827 Switching to VZ requires some manual hackery that we still need to automate: I installed on Ventura on an M1 machine, ran RD once to get settings setup and directories created. Wait until everything is done (I think there is an issue with qemu remaining running if you quit while RD is still starting up). Quit RD and wait until all processes are gone. Then rm -rf ~/Library/Application\ Support/rancher-desktop/lima/0/
echo "vmType: vz" > ~/Library/Application\ Support/rancher-desktop/lima/_config/override.yaml
rdctl start This deletes the old vm and creates the You can see now that qemu is no longer running. I increased the CPU count in preferences beyond 8 (qemu fails when you configure more than 8 CPUs on arm64) and checked that it worked (after the vm was restarted): $ rdctl shell nproc
18 So this looks promising, but still needs some settings to switch between VM modes without manually deleting VMs. I'm thinking initially just something like |
Awesome! We have our devs modify the override.yml file with the yaml tool yq to use the 9p mount type. After the next release we will have them use vz. |
@jandubois just realized this now but a lot of people are using For example to get the Changing the name of the binary to |
I was not aware of that, and it is a really bad idea. We need to tell people to stop doing this.
This can easily be done by I would like to get a list of use-cases why people need to call
I don't think they will break; we are still keeping the regular We may have to break this eventually, but hopefully people have migrated to using |
Thanks for the thorough reply. We do some Go development in containers, to clone private git repos with DOCKER_SSH_SOCK=$(limactl shell 0 printenv SSH_AUTH_SOCK)
docker run \
--rm \
--interactive \
--pull="always" \
--workdir "$(pwd)" \
--mount "type=bind,source=$(pwd),target=$(pwd)" \
--mount "type=bind,source=${HOME}/.ssh/known_hosts,target=/root/.ssh/known_hosts" \
--mount "type=bind,source=${DOCKER_SSH_SOCK},target=${DOCKER_SSH_SOCK},readonly" \
-e "SSH_AUTH_SOCK=${DOCKER_SSH_SOCK}" \
"golang:latest" bash
# Use SSH instead of HTTPS to clone Git repositories
git config --global url.ssh://git@git.acme.com.insteadOf https://git.acme.com/scm
# Go get private go module behind auth
go get git.acme.com/myteam/mygomodule@latest |
Also I could make another contribution to resolve #3042 if a fix for this makes sense in Rancher Desktop. |
Yes, we should make this easier; I'm just not sure how much we can automate. Obviously we should have some setting like E.g. I think it may make sense to have a fixed location for the socket inside the VM, that would be a symlink to the actual socket. That way you don't need to query for SSH_AUTH_SOCK but could use the fixed name. An additional benefit would be that the forwarded socket would continue to work if you shutdown and restart Rancher Desktop: the symlink would be updated automatically, and the container would restart and just continue to use the same symlink. Any other ideas? |
@jandubois that approach worked in my testing, see below. Would that be an improvement to lima? Seems like something all lima users could benefit from. Lima VM:
On My Laptop:
|
This PR resolves issue rancher-sandbox/rancher-desktop#3042 and relates to the comment https://github.com/rancher-sandbox/rancher-desktop/issues/3488\#issuecomment-1406884439. This change ensures the ssh agent socket can be mounted into containers without having to determine the location first. The location will be in a static location /run/host-services/ssh-auth.sock. This is the same location as Docker Desktop uses. Signed-off-by: Ryan Currah <ryan@currah.ca>
Problem Description
The bundled version of Lima does not include Virtiosfs Mount mode support.
Proposed Solution
Sync the forked version of Lima and update
lima-and-qemu
and create a new release of Rancher Desktop. If it doesn't break things.Additional Information
No response
The text was updated successfully, but these errors were encountered: