-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Run .utm from anywhere #1205
Comments
This is especially important when using iCloud and it tries to backup .utm VMs :/ |
Yeah, I just had the same thought when iCloud started uploading the VM... |
Workaround: quit UTM, move your .utm bundles elsewhere, and the symlink them to your Documents folder. |
But .utm files are usually very large. So if you don’t download .utm file in iCloud, it will become very slow to open this file. |
The issue is about not having the files in iCloud in the first place. ;) Simply said, we want to be able to choose where the VMs are stored because the Documents folder is often synced via iCloud Drive. |
Definitely want this feature, running VMs off external drives is the biggest reason why for me.
Just for anyone that might be confused as to how to do this, the command for Terminal is as follows:
|
Hi, In the newest (non App Store) version the symlink works only if the VM is located on the system disk. If I move the .utm bundle to an external USB disk (APFS formatted) and create the symlink, the VM does not show in the UI at all. I also tried to symlink the qcow2 files inside the .utm bundle but I get errors when trying to start the VM:
I've manually granted the UTM app "Full disk access" but it did not help. |
That workaround is outdated from back when UTM was not a sandboxed app. |
I was (am) having the same problem with older versions, it's definitely not new. Would be really nice if we could just add an entry to the UTM GUI and tell it where to find the .utm. |
Yeah that’s why this issue exists as a feature proposal... |
It's a shame that nowadays this kind of functionality is not being built-in into trendy VM software from the very start. It's essential. |
It’s a shame Apple’s apis don’t allow for this to be done easily. It’s open source though why don’t you give it a shot and send a PR once it’s done. We’d all be very thankful 😉 |
Since when did UTM have a price tag. |
Here are some behavior changes that could be in-scope for this issue:
Discussion: Personally I think of .utm files as files that I control. I can torrent them, share them, back them up, delete them, copy them somewhere. And since they are big, I can run them in-place from an external drive. Also, I assume VMs specifically cause a lot or wear on a hard disk so I assume keeping them off a soldered-on main drive is a good idea. Currently, UTM stores all files in a hidden folder that can be many many gigabytes. This is too easy to forget about. I feel that only preferences and minor configuration items should be stored in hidden folders. |
I'm sorry, but I see the inability to store utm files easily where ever you like, especially to external devices, as a huge flaw in the UTM software. This is especially true for software designed for modern Macs, where small internal SSD sizes are unfortunately common on most non-custom ordered machines. The ability to easily run a VM from an external device is not only needed, but in my opinion essential for virtualization software for a Mac. |
I have just experimented the solution as suggested by this post and it worked (i.e. I could run .utm from my external drive) |
Thanks @kevingoh ! I (eventually) got this to work too!! My initial struggle was that I tried to mount the sparse image to the "UTM" (which is actually "com.utmapp.UTM") and then UTM just seemed to ignore the link and create a new "UTM" folder. I then mounted a sparseimage to the "Data" sub-folder, and this seemed to work fine! Did you got it to work at the UTM folder level ? (I do think it is cleaner/neater to link at the UTM level... but I am also quite fine with my link at the "Data" folder level, as it seems to be working fine) |
Thanks. This is current method to run .utm vms from external drive. It works. I create a shell script to run it automatically.
It's not perfect but it works. |
Hi, |
It did not work with me, can you describe how you do that? It does not appear my UTM when I make a symlink of the UTM file that is on the external disk. |
When I try this I got the error “com.utmapp.UTM” couldn’t be", any suggestions? |
Would be great if there is any solution, because my Mac Mini M1 only has 256GB internal SSD... |
The link above worked for me afterwards (after spending time and figuring out what is going on exactly) , so it is doable for sure, but M1 does not support Ubuntu 18.04 natively so it is not practical for some use cases but 20.04 works like a charm. |
Firstly you need to make a file such as
Don't forget to change your folder's path, where you want to be mounted to on your external SSD. E.g. I was using a SN550 1T hard drive. |
Can someone make a video about it so we can run it on our external drive? I am getting a errors and I probably doing something wrong. No idea how to run shell script on my mac. |
@xros So the hdiutil attach command needs to be run, each time I wanna attach the sparse image. right? Assuming Yes, I created an alias in .zshrc |
Yes currently you have to run it everytime when you want to use UTM. I glad that helps you. 😉 |
For those of you writing external scripts to mount images for use in UTM... To me the point of UTM is that it's something contained that will be allowed on the app store and provides simple, visual "yes this just works" options for easy use. So any solutions provided should be things that work with sandboxed apps. Maybe it's just a case of entitlements being set correctly, so there's access to the ~/Documents folder? |
@adespoton can you please give some steps on how to do it exactly |
@ipriyam26 do which exactly? Run QEMU without UTM? Or how to add entitlements to UTM so that it can use the ~/Documents/ folder instead of the ~/Library/Containers/ folder? For the first, take the UTM QEMU export string and strip out all the SPICE components, install homebrew on your Mac, and run brew install qemu. Then from the terminal (or a .sh or .command file) run the string UTM generated, but point the drive image at whatever location you want instead of the copy in the UTM container folder. If you want SPICE integration, you'll have to go to the QEMU website, download QEMU, go to the SPICE website, download the SPICE source, and compile QEMU with the SPICE flags set. If there's already a keg set up on homebrew for SPICE-enabled QEMU, I don't know about it. |
Implemented as part of #132 |
I figured I'd post what I consider potato head instructions, cause creating a sparse image wasn't easy STEP 1 - create the sparse imageOpen Disk Utility. Create a new Blank Image Save As: Documents STEP 2QUIT UTM STEP 3 -EJECT THE SPARSE IMAGE FROM DISK UTILITY STEP 3MOUNT THAT SPARSE IMAGE
STEP 4 - PROFIT!now you should be able to start UTM and your VMs should show up. Be mindful, they are a bit slower but not by much |
Exactly! Sorry I didn't write it clearly in my last post. Hope UTM can really consider to customize the file path of your VMs once AGAIN! |
This command worked for me on M1 mac and copying the data folder as a whole |
Hey guys, I am giving the steps from the beginning: install UTM on Mac Cons: You have to do this manually for each VM you create. Anyways we achieved what we want. Peace :) |
@anuprshetty this must be new functionality that osy got working. thanks for posting. I'll try this out |
I tried the right-click on the VM and move to external SSD but the app just hangs and uses 100% CPU so I killed it. They need to get the copy in a background thread and show progress in the UI. |
Move (=copy) sparse images can get super-slow, like really days I hear. Has anyone suffered that? I've had it slow but not THAT slow, mostly I have had success without using the copy routines coded within UTM [ I was OK moving uVM folders using Finder]. I believe someone (osy?) had maybe forked in UTM code to fix the slow copying. Also finding it very sketchy looking at file sizes and their exact nature: is it macOS sparse, clone (?which may induce CoW behaviour on top of qcow2 format which again uses CoW). Often the package (eg reveal package contents) in macOS may be much larger or smaller than the apparent size of the files within it. Not enough time to really study this issue, yet... I also suspect Finder moves between drives may end up with something UTM will find/treat/result as a Clone (in macSO view) - which AFAIK should not be the case (at least on initial copy). YMMV I'm interested to hear... malhal is right about the copying issue, I run iostat in terminal to watch disc activity when UTM does any disc thing - this allows me to see how it progresses, size and number of transfers, when it ends, how long it took... |
It would be nice to be able to store the .utm VMs some where else than ~\Documents, for exemple an attached disk.
Version
2.0.13(13)
The text was updated successfully, but these errors were encountered: