chilcote / vfuse Goto Github PK
View Code? Open in Web Editor NEWConvert bootable DMG images for use in VMware Fusion
Convert bootable DMG images for use in VMware Fusion
Hi
I need to create a thin provisioned disk to use with vSphere. It's the disk option 6.
Here is the template I've used:
{
"source_dmg": "/Users/yoann/Pro/SystemImage/osx_updated_160626-10.11.5-15F34.hfs.dmg",
"output_dir": "/Users/yoann/Pro/vSphereTemplate",
"output_name": "OS X 10.11.5",
"cache": false,
"hw_version": 11,
"mem_size": 2048,
"disk_type": 6,
"bridged": false,
"hw_model": "11",
"use_qemu": false
}
And here is the run log:
If you don't want to be prompted in the GUI for an admin password, run this script with sudo rights
Mounting /Users/yoann/Pro/SystemImage/osx_updated_160626-10.11.5-15F34.hfs.dmg
OS X version is 10.11.5
VMware hardware version 11 does not officially support 10.11
Using VMware Fusion path: /Applications/VMware Fusion.app
Converting DMG to VMDK
Error: VMware Virtual Disk Manager can only convert to ESX thin disks if the destination is remote.
Unmounting Base OS DMG
According to the VMware documentation the right command to use is vmware-vdiskmanager -r sourceDisk.vmdk -t 4 -h esx3.example.com -u root -f password.txt "[storage1] <VMname>/targetDisk.vmdk"
..for example, if you install Fusion via brew-cask, you'll have somewhere in /opt/caskroom
and a symlink in ~/Applications/VMware Fusion.app
.
Would you consider a PR to support alternate install directories? This could be done either by:
cmd = ['/usr/bin/mdfind', 'kMDItemCFBundleIdentifier == com.vmware.fusion']
and picking the first result.@chilcote fixed in Vmware version 11.1.0
Good news!
Hello,
This week I upgraded my Mac to macOS Catalina and my VMWare Fusion to 11.5. When I try to create new VMDK from DMGs made from AutoDMG I get the following:
Desktop % sudo /usr/local/vfuse/bin/vfuse -i /Volumes/SuperMac-Extreme/JAMFCompatibleVM/osx-10.14.6-18G95.apfs.dmg
Password:
Mounting /Volumes/SuperMac-Extreme/JAMFCompatibleVM/osx-10.14.6-18G95.apfs.dmg
macOS version is 10.14.6
Unmounting /Volumes/Macintosh HD 1
Using VMware Fusion path: /Applications/VMware Fusion.app
Converting DMG to VMDK
|Error: Unable to create the source raw disk: The specified device is not a valid physical disk device (20).
There is a problem with your DMG; please re-create it and try again
These dmg files worked prior to my upgrades with vfuse. Are there any known issues with macOS Catalina, VMWare Fusion 11.5, and vfuse 2.2.4? I even upgraded my AutoDMG 1.10b and tried creating a macOS Catalina dmg and ended up with the same thing:
Desktop % sudo /usr/local/vfuse/bin/vfuse -i /Volumes/SuperMac-Extreme/JAMFCompatibleVM/osx-10.15-19A602.apfs.dmg
Password:
Mounting /Volumes/SuperMac-Extreme/JAMFCompatibleVM/osx-10.15-19A602.apfs.dmg
macOS version is 10.15
Unmounting /Volumes/Macintosh HD 1
Using VMware Fusion path: /Applications/VMware Fusion.app
Converting DMG to VMDK
|Error: Unable to create the source raw disk: The specified device is not a valid physical disk device (20).
There is a problem with your DMG; please re-create it and try again
Thanks for your assistance!
We've discussed this a bit in #virtualization on the MacAdmins Slack but I thought I'd open it here so there'd be a record of the issue. When attempting to build a 10.13 VM with VMware Fusion on a 10.13 machine I get the following error:
[Errno 2] No such file or directory: '/Volumes/Preboot 1/System/Library/CoreServices/SystemVersion.plist'
relates to Homebrew/homebrew-core#54541
==> brew test --verbose vfuse
==> FAILED
Testing vfuse
/usr/bin/sandbox-exec -f /private/tmp/homebrew20200510-10086-1namqwk.sb ruby -W0 -I $LOAD_PATH -- /usr/local/Homebrew/Library/Homebrew/test.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vfuse.rb --verbose
==> /usr/local/Cellar/vfuse/2.2.6/bin/vfuse --version
Error: vfuse: failed
An exception occurred within a child process:
Test::Unit::AssertionFailedError: </2\.2\.6/> was expected to be =~
<"2.2.5\n">.
I got the following error when attempting to follow instructions from PSU talk and Creating a vagrant box using packer-template.json included in the repo.
ryan@AIR-ML-RMANLY vfuse $ /usr/local/packer/packer build ./packer-template.jsonFailed to parse template: 2 error(s) occurred:
* variable install_vagrant_keys: '' expected type 'string', got unconvertible type 'bool'
* variable update_system: '' expected type 'string', got unconvertible type 'bool'
I also found that Tim addressed this a few days ago.
When using a vfuse template to build a Netboot ready VM, it would be great to have the ability to specify the (temp) build path. While the default is understandably "/tmp/", this can be problematic if adequate space isnt available.
Perhaps something akin to:
"tmp_dir": "/Volumes/PlentyoSpace/VMs/",
Thanks.
Yesterday I was creating VMs fine using using the latest version of vfuse and VMware Fusion Pro 10.1.3. Today, any VMs I create with vfuse throw an error This virtual machine was created by a newer version of VMware Fusion.
I've tried updating to Fusion Pro 11, downgrading to Fusion Pro 10.1.1, and I always get the same error with VMs generated by vfuse and opened in VMware Fusion Pro.
Hello,
I used DiskUtility to create an image of a never-booted hard drive. The file is called MacHD.dmg.
This is the traceback I get:
Traceback (most recent call last):
File "./vfuse", line 327, in
main()
File "./vfuse", line 295, in main
mount_point, disk_id = mount_dmg(source_dmg)
File "./vfuse", line 104, in mount_dmg
mount_point = output.split('\n')[-3].split('\t')[-1].strip()
IndexError: list index out of range
I have successfully converted a dmg created from AutoDMG.
Thanks for any thoughts.
Hi
Looking at https://github.com/chilcote/vfuse/wiki/Received-signal-11 you say
First, you need to install qemu-img. Now, you could use homebrew, like an animal. Which is fine. I mean, if you have to. But the more discerning among you will prefer to install it with macports
Which a perfectly fine point of view :-)
But latter you also say:
If you don't supply a path, then vfuse will plug its nose and assume you installed it with brew and look for it at /usr/local/bin/qemu-img.
Why making things simpler for animals and not for people who do things right? :p
More than a troll, I would like to propose to replace the default value by a call to qemu-img
with no path, and let the system rely on a properly configured PATH
, regardless of the species of sys admin.
When i escape a directory in the template, I get a ValueError
Example with "output_dir": "/Users/fti/Documents/Virtual\ Machines.localized",
berry:~ $ /usr/local/vfuse/vfuse -t /Volumes/SONY_16X/2-vfuse_vanilla_template.json
If you don't want to be prompted in the GUI for an admin password, run this script with sudo rightsTraceback (most recent call last):
File "/usr/local/vfuse/vfuse", line 649, in
main()
File "/usr/local/vfuse/vfuse", line 526, in main
d = import_template(args.template)
File "/usr/local/vfuse/vfuse", line 77, in import_template
d = json.load(f)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 290, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Invalid \escape: line 3 column 48 (char 137)
berry:~ $
latest vmware fusion uses hardware version 14. vfuse should use this version to reduce the "would you like to upgrade this machine?" message every time when booting up a vm.
Your list of requirements includes "VMware Fusion 8.x Professional". Can you explain why the Professional version is required?
The vmware-vdiskmanager tool, used here has -t 4 option to generate a preallocated VMDK usable on ESX and ESXi. This is useful for doing P2V without the need to first import the vm into Fusion.
When downloading a dmg, it would be awesome if you could specify a checksum in case of failed downloads.
As the title says generate an initial snapshot when created a VM
When trying to convert a DMG I'm getting the following returned:
Traceback (most recent call last):
File "/Users/admin/Downloads/vfuse-master/pkgroot/usr/local/vfuse/vfuse", line 844, in
main()
File "/Users/admin/Downloads/vfuse-master/pkgroot/usr/local/vfuse/vfuse", line 746, in main
mount_point, disk_id, volume_kind = mount_dmg(source_dmg)
File "/Users/admin/Downloads/vfuse-master/pkgroot/usr/local/vfuse/vfuse", line 144, in mount_dmg
if i['content-hint'] == 'GUID_partition_scheme':
KeyError: 'content-hint'
I'm unsure what this means or how to resolve it.
Hey Joe,
You planning on supporting High Sierra (10.13)?
I just tried it and got this:
Mounting osx-10.13-17A365.apfs.dmg
macOS version is 10.13
This macOS version is not supported: 10.13
Unmounting Base OS DMG
Not a Parallels fan personally, but some of our clients uses it. Any plans to add Parallels compatibility?
YAML is a nice format but sadly there is no support for it in Cocoa or the Python standard library. Is YAML a requirement for your integration needs or would you consider a patch replacing it with something supported by the built-in modules (e.g. plist/json/ini)?
Given:
osx-10.15.4-19E287.apfs.dmg
...when I run...
% vfuse -i osx-10.15.4-19E287.apfs.dmg
...I was expecting a virtual machine to be generated with the default name macos-vm.vmwarevm
.
Actually I get the following error and no VM is generated:
Mounting osx-10.15.4-19E287.apfs.dmg
Traceback (most recent call last):
File "/usr/local/vfuse/bin/vfuse", line 1201, in <module>
main()
File "/usr/local/vfuse/bin/vfuse", line 1051, in main
mount_point, disk_id, volume_kind = mount_dmg(source_dmg)
File "/usr/local/vfuse/bin/vfuse", line 282, in mount_dmg
return mount_point, disk_id, volume_kind
UnboundLocalError: local variable 'mount_point' referenced before assignment
%
hdiutil
shows the .dmg as mounted after the failure. Cleaning that up using
hdiutil info | grep /dev/disk | grep partition | cut -f 1 | xargs -I {} hdiutil detach {}
...and retrying vfuse
produces the same result.
Per our IRC discussion.
A few options here:
Or
This means that you can't configure vfuse prior to installing the package. Perhaps this should be up to the admin and not just putting one there?
This will then help with facebooks's cpe_vfuse so you can configure vfuse but not necessarily install it with chef and then later install it and not need another chef run.
When trying to use vfuse to create the VMware image, we're getting the error "Error: Received Signal 11" during then immediately having the process fail.
I have replicated this with the following.
System OS: macOS 10.13.6
Original DMG: macOS 10.13.6
vFuse Version: 2.0.6
AutoDMG Version: 1.9
and
Round 1
System OS: macOS 10.14.0
Original DMG: macOS 10.13.6
vFuse Version: 2.0.6
AutoDMG Version: 1.9
Round 2
System OS: macOS 10.14.0
Original DMG: macOS 10.14.0
vFuse Version: 2.0.6
AutoDMG Version: 1.9
Output
Password:
Mounting osx-10.13.6-17G65.apfs.dmg
macOS version is 10.13.4
Unmounting /Volumes/Macintosh HD 1
Using VMware Fusion path: /Applications/VMware Fusion.app
Converting DMG to VMDK
/Error: Received signal 11.
Unmounting /dev/disk3```
Unsure why this is failing on High Sierra with another High Sierra installer when this worked previously.
Thanks to a tip from @morgrowe, I learned it's possible to use the qemu-img to convert a DMG to a VMDK, without a need for VMware Fusion or sudo
, and only qemu
from homebrew. I tested swapping in the command into vfuse
in place of the two vmware-
tools and let it set up the rest of the .vmwarevm
file as usual, and it works.
The length of time required to convert the image is nearly identical. Would you be interested in a PR that would add this as an alternate "mode" for vfuse? This means it would skip the check for running as root and for VMware, as neither of those things should be required. (As you might guess I like the lack of those requirements, as least for the case of generating this image on a throwaway machine that may not have VMware installed.)
Two different builds of 10.14.4
trying to use vfuse with template that worked before creating a new image for 10.14.4
Get the following error.
Thanks
[Errno 2] No such file or directory: '/Volumes/Install macOS Mojave/System/Library/CoreServices/SystemVersion.plist'
Update
Using the Install_macOS_10.14.3-18D42.dmg there are no issues creating a new VM
Heya... I'm sure this is just about the dumbest question regarding vfuse you've received. I'm new to github and have no idea how to install vfuse so that I can use it locally on my device. I've installed software from other github projects where an installer is present or a dmg (AutoDMG, for example), but have no idea how to install vfuse. Sorry to be such a boneheaded newb, but a step by step would really appreciated. Thanks in advance, and again my apologies for having to deal with such an idiot. :)
The colored function is used in the try/except block wrapping the yaml import but it is defined a few lines down which causes a traceback if yaml could not be imported. Moving the yaml import block after the definition of colored works fine.
I can build vms fine with the Model identifier and serial to test out DEP workflows. The issue is after filevault is enabled through our scripted provisioning and restarts the vm blue screens and doesn't boot. This is all macOS versions where the DMG is made with AutoDMG.
We have always had this problem but i have only just got around to logging this now.
ref: https://github.com/chilcote/vfuse/wiki/Vagrant
When creating my new 10.13 Vagrantbox I got some issue with hgfs not loaded and therefor shared folders not available.
The reason:
Kernel Extensions will not load, because kexts are blocked awaiting userconsent.
The fix:
Before you build your image with AutoDMG do the following modification to the vagrant-outset package.
add the following script in: vagrant-outset/pkgroot/usr/local/outset/boot-every/disable_kext_userconsent.sh
#!/bin/bash
#Disable kernel extensiopn approving
/usr/sbin/spctl --disable
Remember to chmod a+x on the script.
then build a new version of vagrant-outset: make pkg
Add this to the packagearray in autodmg and proceed with the instructions on the https://github.com/chilcote/vfuse/wiki/Vagrant
K
The latest version (2.0.3) fails to build an image when using the full path of a template json file.
vfuse -t /full/path/to/template.json
Unable to find template: /full/path/to/template.json
is received.I believe the manual override you can perform at this time(was it @Golby who was tweeting about this?) is to modify it with vdiskmanager here: https://github.com/chilcote/vfuse/blob/master/vfuse#L182-L187
Sorry I'm not leading with a PR, hope this is a good placeholder for someone to confirm the above is correct in the meantime.
Hey Joe,
What might be the cause of this?
/usr/local/vfuse/vfuse -s SERIAL -w MacBookPro11,5 -i images/Sierra_170202-10.12.1-16B2657.hfs.dmg
usage: vfuse [-h] [-i INPUT] [-o OUTPUT] [-n NAME] [-w HW_VERSION]
[-m MEM_SIZE] [-s [SERIAL]] [-t TEMPLATE] [-e] [-p PACKER] [-d D]
[--hw-model HW_MODEL] [--start [START]] [--stop STOP]
[--reset RESET] [--use-qemu] [--recovery]
vfuse: error: argument -w/--hw-version: invalid int value: 'MacBookPro11,5'
I cloned the package and ran make pkg on it, and installed. everything went according to plan until I tried to run it, and it came up with an attribute error: AttributeError: 'Namespace' object has no attribute 'start' any help?
I created a 10.8 VM with vfuse, starting with a plain 10.8 AutoDMG.
Mounting ~/osx10.8.5-12F45-generic.hfs.dmg
OS X version is 10.8.5
Converting DMG to VMDK
Populating VMX file
Unmounting Base OS DMG
VMware Fusion VM created at ~/Documents/Virtual Machines.localized/vFuse Mac OS X 10.8.vmwarevm
However, upon launching the VM, I get this:
Clicking Browse doesn't reveal any .vmdk files to choose from:
My host Mac has 10.10.1 and VMware Fusion 8.0.2, and is up to date with vfuse commit 12960d7.
Anything I can try to troubleshoot?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.