Comments (10)
Looks like this project is currently lacking any unit or integration tests which makes trying to troubleshoot a game of cat and mouse and quite likely to lead to unintended side effects if any changes are made to how things work. I was really excited about having a Python alternative to Vagrant that doesn't cost a bunch of money, but not having any tests makes it very hard to recommend or even to try to contribute because I'll have no idea what I'm breaking when I try to fix things.
from mech.
I haven’t tried this too much, but I think you need to give it the name as well (during init). Create a new directory and inside it do:
mech init windows_2008_r2 /some/path/to/windows_2008_r2_vmware
Please let me know if this works.
from mech.
Hi, I have attempted this. I can say that this does not work, even with the --name option.
Simply put, the same output occurs:
$ mech init --name=metasploitable3-ub1404 /path/to/the/metasploitable3-ub1404-vmware.box
Initializing mech
A Mechfile has been initialized and placed in this directory. You
are now ready to mech up your first virtual environment!
$ mech up
Provided box name is not valid
Loading metadata for box 'metasploitable3-ub1404-vmware'
Bad response from HashiCorp's Vagrant Cloud API: 404 Client Error: Not Found for url: https://app.vagrantup.com/metasploitable3-ub1404-vmware/boxes/boxes
And for without the --name option,
$ mech init metasploitable3-ub1404 ~/mech/metasploitable3-ub1404-vmware.box
Initializing mech
A Mechfile has been initialized and placed in this directory. You
are now ready to mech up your first virtual environment!
$ mech up
Provided box name is not valid
Loading metadata for box 'metasploitable3-ub1404'
Bad response from HashiCorp's Vagrant Cloud API: 404 Client Error: Not Found for url: https://app.vagrantup.com/metasploitable3-ub1404/boxes/boxes
Here is the generated Mechfile (ran without --name):
$ cat Mechfile
{
"box": "metasploitable3-ub1404",
"file": "/path/to/the/metasploitable3-ub1404-vmware.box",
"name": null
}
from mech.
You should use mech box add NAME PATH
before attempting to mech init NAME
. They have done a great job of keeping the CLI interface very similar to Vagrant for most operations.
See https://github.com/mechboxes/mech/blob/master/mech/mech.py#L206 for syntax or use mech box --help
to see the options.
from mech.
It appears there is an issue with the tar
syntax on Ubuntu 18.04, mech
tries to use *.vmx
but without --wildcards
it gets interpreted as a filename and fails.
mech box add eval-win10 /projects/github/boxcutter-windows/box/vmware/eval-win10x64-enterprise-nocm-1.0.4.box
Checking box 'eval-win10' integrity...
tar: Pattern matching characters used in file names
tar: Use --wildcards to enable pattern matching, or --no-wildcards to suppress this warning
tar: *.vmx: Not found in archive
tar: Exiting with failure status due to previous errors
But a vmx file IS there.
tar --list -f /projects/github/boxcutter-windows/box/vmware/eval-win10x64-enterprise-nocm-1.0.4.box
Vagrantfile
disk-s001.vmdk
disk-s002.vmdk
disk-s003.vmdk
disk-s004.vmdk
disk-s005.vmdk
disk-s006.vmdk
disk-s007.vmdk
disk-s008.vmdk
disk-s009.vmdk
disk-s010.vmdk
disk-s011.vmdk
disk.vmdk
eval-win10x64-enterprise.nvram
eval-win10x64-enterprise.vmsd
eval-win10x64-enterprise.vmx
eval-win10x64-enterprise.vmxf
metadata.json
from mech.
It looks like this should be working from a glance at this function, but I haven't fully stepped through it yet. https://github.com/mechboxes/mech/blob/master/mech/utils.py#L324
from mech.
OK, it looks like the \b--wildcards\b
isn't matching properly in the tar --help
subprocess output, though removing the \b
bits seems to have fixed it in my case and I was able to get the box properly added.
This was under Python 3.6.8 on Ubuntu 18.04 (using Pyenv to manage versions but that shouldn't matter in this case).
from mech.
Urrggggh, got the box added, but had to supply a path to the box again when doing mech init
instead of just mech init JUST_ADDED_BOX_NAME
so it was mech init NAME PATH
, though I used the ~/.mech/boxes/NAME/FILENAME.box
as the PATH, but it still won't let me mech up
even though it successfully creates a Mechfile in the directory.
from mech.
So it looks like the trouble is related to local mech box add
NOT properly going through the extraction of the VMX file and other bits to the ~/.mech/boxes/BOXNAME/
path so when trying to bring it up by name it doesn't have a VMX to reference and match against. If I find some more time I'll take a look deeper, but for now I'm off to manually start some VMs with vmrun
.
from mech.
@espoelstra Do you have a pull request for this issue . I would try it :) . It seems that there is an issue with some freebsd images . I can't import them . Than I started to build my own box , but now I can't add it .... .
from mech.
Related Issues (20)
- Provision Shell Script HOT 1
- Could I mech up multiple machines with a single Mechfile? HOT 7
- Mech up and init not working window 10 and Workstation 14 HOT 4
- Windows 10 tar: Cannot connect to C: resolve failed
- mech up error VIX_SERVICEPROVIDER_VMWARE_WORKSTATION (windows 10/vmware workstation player 14)
- Don't add more things to ~/.
- Fail to load mech ssh HOT 1
- Laravel Homestead - Config file
- mech destroy has OSError after running vmrun deleteVM
- json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes if `~/.mech/data/index` was broken
- Mech init TypeError: unorderable types: NoneType() < str()` HOT 2
- Can't start VM from different folder
- Host always shows as "mech" when running "mech ssh-config" command
- add the ability to disable shared folders HOT 3
- need info from windows instances
- override the vcpus and/or memory for an instance
- Is this repo still alive? HOT 5
- Mechfile config settings
- Provisioning of SHELL lines
- Cannot find a valid box with a VMX file in tar archive HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mech.