Skip to content
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

Shorten package name #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

dezull
Copy link
Contributor

@dezull dezull commented Feb 28, 2020

When packaging a box with a long path, it will fail at tarring:

$ vagrant package --output /home/user/thing/projects/subdir/myvm.box myvm

==> myvm: --- Attempting to package
==> myvm: --- boxname: -VAGRANTSLASH-home-VAGRANTSLASH-user-VAGRANTSLASH-thing-VAGRANTSLASH-projects-VAGRANTSLASH-subdir-VAGRANTSLASH-myvm.box.box
VMware ovftool 4.3.0 (build-10104578)
Opening VI source: vi://[email protected]:443/
Opening VMX target: ZZZZ_tmpdir
Writing VMX file: ZZZZ_tmpdir/-VAGRANTSLASH-home-VAGRANTSLASH-user-VAGRANTSLASH-thing-VAGRANTSLASH-projects-VAGRANTSLASH-subdir-VAGRANTSLASH-myvm.box/-VAGRANTSLASH-home-VAGRANTSLASH-user-VAGRANTSLASH-thing-VAGRANTSLASH-projects-VAGRANTSLASH-subdir-VAGRANTSLASH-myvm.box.vmx
Transfer Completed
Completed successfully
==> myvm: tarring -VAGRANTSLASH-home-VAGRANTSLASH-user-VAGRANTSLASH-thing-VAGRANTSLASH-projects-VAGRANTSLASH-subdir-VAGRANTSLASH-myvm.box.box
tar: AGRANTSLASH-home-VAGRANTSLASH-user-VAGRANTSLASH-thing-VAGRANTSLASH-projects-VAGRANTSLASH-subdir-VAGRANTSLASH-myvm.box.vmx: Volume label is too long (limit is 99 bytes)
Try 'tar --help' or 'tar --usage' for more information.

This PR makes package works similarly to virtualbox provider, eg:

$ vagrant package --output /home/user/thing/projects/subdir/myvm.box myvm
==> kali: Clearing any previously set forwarded ports...
==> kali: Exporting VM...
==> kali: Compressing package to: /home/user/thing/projects/subdir/myvm.box

Remove trailing paths.
@josenk
Copy link
Owner

josenk commented Mar 5, 2020

I don't think that --output option should be a full path??? According to the documentation, it's just a "NAME".

https://www.vagrantup.com/docs/cli/package.html

  • --output NAME - The resulting package will be saved as NAME. By default, it will be saved as package.box.

The public boxes: https://app.vagrantup.com/boxes/search that contain a slash "/", all get downloaded as "VAGRANTSLASH".
For example:

So, I use that format for the NAME...

@dezull
Copy link
Contributor Author

dezull commented Mar 5, 2020

I think that behaviour was changed a while ago? see hashicorp/vagrant@b026be7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants