-
Notifications
You must be signed in to change notification settings - Fork 434
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
windows_2016_docker.json produces 0 byte vmdk #87
Comments
Which version of Packer do you use? |
Do you have enough free disk space to hold the 10 GByte file? |
I'm using version |
The box size looks good. Can you list the content of the box file?
|
$ tar tvf windows_2016_docker_virtualbox.box
-rw-r--r-- 0 bitbear staff 2286 Mar 1 20:50 Vagrantfile
-rw-r--r-- 0 bitbear staff 0 Mar 1 20:50 WindowsServer2016Docker-disk001.vmdk
-rw-r--r-- 0 bitbear staff 10412 Mar 1 20:50 box.ovf
-rw-r--r-- 0 bitbear staff 26 Mar 1 20:50 metadata.json |
Well, I don't know where the error during the packer build happened to produce this corrupt box file. |
I’ve rebuilt the box four times due to other hints I’ve found around the web of what the problem might be. Nothing has helped, which is why I ended up asking here. I’ll definitely try your box from Vagrant cloud, thanks! |
Can duplicate. macOS 10.13.3 $ vboxmanage --version $ ls -lh *.box
-rw-r--r-- 1 tanner staff 10G Mar 4 03:30 windows_2016_docker_virtualbox.box The .box is 10G in size $ tar -tvf windows_2016_docker_virtualbox.box
-rw-r--r-- 0 tanner staff 2286 Mar 4 03:25 Vagrantfile
-rw-r--r-- 0 tanner staff 0 Mar 4 03:25 WindowsServer2016Docker-disk001.vmdk
-rw-r--r-- 0 tanner staff 10412 Mar 4 03:25 box.ovf
-rw-r--r-- 0 tanner staff 26 Mar 4 03:25 metadata.json But the .vmdk is zero? Where is the 10G of disk space coming from? $ tar -xvzf ../windows_2016_docker_virtualbox.box
x Vagrantfile
x WindowsServer2016Docker-disk001.vmdk: Attempt to write to an empty file
x box.ovf
x metadata.json
tar: Error exit delayed from previous errors. $ ls -alh
total 40
drwxr-xr-x 6 tanner staff 204B Mar 4 15:02 .
drwxr-xr-x 72 tanner staff 2.4K Mar 4 15:00 ..
-rw-r--r-- 1 tanner staff 2.2K Mar 4 03:25 Vagrantfile
-rw-r--r-- 1 tanner staff 0B Mar 4 03:25 WindowsServer2016Docker-disk001.vmdk
-rw-r--r-- 1 tanner staff 10K Mar 4 03:25 box.ovf
-rw-r--r-- 1 tanner staff 26B Mar 4 03:25 metadata.json Maybe this? https://en.wikipedia.org/wiki/Hierarchical_File_System Is your filesystem hfs? Because all my Mac's are upgrades from previous versions of macOS or OSX they are hfs. This week I'll head to the lab and convert hfs to apfs. Needs to be doing via safe mode. |
Yes, I'm using HFS+ since I have a Fusion drive. I'm waiting for Fusion support in APFS before I convert. |
HFS+ has Max. file size | 8 exabyte |
@StefanScherer: Your Vagrant cloud box booted just fine. Thank you! Now I just need to figure out how to use it as a |
Interesting, so HFS+ does not have a problem with the box file size and extracting the contents.
To see which command is called during the box file creation. |
Not seeing anything obvious in the logs. Going to do a packer with "keep_input_artifact": true |
"keep_input_artifact": true output-virtualbox-iso/ $ ls -l
total 21220296
-rw-r--r-- 1 tanner staff 10864777216 Mar 5 18:46 WindowsServer2016Docker-disk001.vmdk
-rwx------ 1 tanner staff 10412 Mar 5 18:23 WindowsServer2016Docker.ovf $ ls -l *.box
-rw-r--r-- 1 tanner staff 10729788371 Mar 5 18:56 windows_2016_docker_virtualbox.box $ tar -tvf windows_2016_docker_virtualbox.box
-rw-r--r-- 0 tanner staff 2286 Mar 5 18:51 Vagrantfile
-rw-r--r-- 0 tanner staff 0 Mar 5 18:51 WindowsServer2016Docker-disk001.vmdk
-rw-r--r-- 0 tanner staff 10412 Mar 5 18:51 box.ovf
-rw-r--r-- 0 tanner staff 26 Mar 5 18:51 metadata.json |
Thanks. This really looks like a problem inside packer
The tar file is created internally: https://github.com/hashicorp/packer/blob/4d3a762e85e7e8050134a4e33e1f87a54029dcb8/post-processor/vagrant/util.go#L71-L155 |
Can duplicate this problem with macOS sierra (10.12.6) and HFS+ filesystem. Time to open a bug in the packer project? Or maybe an issue in golang? |
There's one config option Issue with Golang or one of the imported packages?, maybe. An issue in packer project may help to get some feedback. But I haven't seen a similar issue there yet, so probably most people work with much smaller vmdk sizes. |
@asbjornu With With later Windows Server like 1709, 1803, ... and latest nightly Docker builds you may use LCOW to start Linux containers directly on the Windows Docker host. But this works only with HyperV enabled in the VM, but VirtualBox does not have nested virtualization feature to do that. |
@StefanScherer: Thanks. As I write in docker/compose#3987 (comment) I finally figured this out as well. I hoped to not have to start from scratch with Docker Swarm, since I've never used it before and really enjoy the simplicity of Docker Compose. I might as well just go with Kubernetes then, since I know that better than Docker Swarm, but it too adds infinite amounts of complexity I don't really want to deal with in this very simple demo project.
Yeah, I considered that but VirtualBox makes that impossible. So I don't really know what to do. I think I might just manually run Octopus Deploy within a Windows VM and skip Docker for this purpose altogether. |
The workaround for now: Use Packer 1.1.3 I just rebuilt a VirtualBox box file (
|
Created golang/go#24599 for further investigation. |
Everything from brew works for me now. Just adding the below for work around(?) until the golang people find the fix.
|
@basictheprogram Your fix/workaround includes using the homebrew GNU tar and replacing the embedded tar in Vagrant? |
@StefanScherer Nope. I think something changed in packer 1.2.2 from homebrew. |
Weird. But as long as it works for you. |
I'm trying to get Octopus Deploy run in Docker (version
18.03.0-ce-rc1, build c160c73
) on my macOS 10.12.6. I've installed VirtualBox (version5.2.8r121009
), downloaded the Windows 2016 ISO and seemingly successfully executed the following command:packer build --only=virtualbox-iso -var 'iso_url=/Users/bitbear/Downloads/14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_EN-US.ISO' windows_2016_docker.json
After a few hours, this command finishes with the following:
However, when I execute the following command, a
.box
file is created with aWindowsServer2016Docker-disk001.vmdk
file in it that is 0 bytes in size:After copying
vagrantfile-windows_2016.template
toVagrantfile
and modifying it according to work with my setup,vagrant up
fails with the following:When I inspect the file
/Users/bitbear/.vagrant.d/boxes/windows_2016_docker/0/virtualbox/WindowsServer2016Docker-disk001.vmdk
, it is indeed an empty file of 0 bytes in size. Any ideas what might be causing this and how I can fix it?The text was updated successfully, but these errors were encountered: