Giter Site home page Giter Site logo

Comments (25)

StefanScherer avatar StefanScherer commented on September 2, 2024

Which version of Packer do you use?
My latest builds are done with Packer 1.1.3.
Which size is the box file? It should be about 10 GByte.

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

Do you have enough free disk space to hold the 10 GByte file?

from packer-windows.

asbjornu avatar asbjornu commented on September 2, 2024

I'm using version 1.2.1 of Packer and I have 160 GB of free disk space. The .box is 10.89 GB. Opening the .box in an archive browser, I can see a WindowsServer2016Docker-disk001.vmdk file in there at 0 bytes in size.

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

The box size looks good. Can you list the content of the box file?
It should look like this:

$ .\tar.exe tvf .\windows_2016_docker_virtualbox.box
-rw-rw-rw-  0 0      0        2347 Jan 23 01:43 Vagrantfile
-rw-rw-rw-  0 0      0 10767669248 Jan 23 01:43 WindowsServer2016Docker-disk001.vmdk
-rw-rw-rw-  0 0      0       10416 Jan 23 01:43 box.ovf
-rw-rw-rw-  0 0      0          26 Jan 23 01:43 metadata.json

from packer-windows.

asbjornu avatar asbjornu commented on September 2, 2024
$ 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

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

Well, I don't know where the error during the packer build happened to produce this corrupt box file.
I would suggest to just rebuild the box and see if it works. You could also use the StefanScherer/windows_2016_docker box from Vagrant cloud.

from packer-windows.

asbjornu avatar asbjornu commented on September 2, 2024

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!

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

Can duplicate.

macOS 10.13.3
$ packer --version
1.2.1

$ vboxmanage --version
5.2.8r121009

$ 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
Max. file size | 2 GB (2 × 10243 bytes)

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.

from packer-windows.

asbjornu avatar asbjornu commented on September 2, 2024

Yes, I'm using HFS+ since I have a Fusion drive. I'm waiting for Fusion support in APFS before I convert.

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

HFS+ has Max. file size | 8 exabyte

from packer-windows.

asbjornu avatar asbjornu commented on September 2, 2024

@StefanScherer: Your Vagrant cloud box booted just fine. Thank you! Now I just need to figure out how to use it as a DOCKER_HOST for just one of many Docker images I want to boot with docker-compose. I've searched but found no way to declare one image's DOCKER_HOST in docker-compose, do you know if this is possible, or do I need to run all images in the same host?

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

Interesting, so HFS+ does not have a problem with the box file size and extracting the contents.
So it seems a problem while creating the tar file.
You can run Packer with debug output

export PACKER_LOG=1
packer build ...

To see which command is called during the box file creation.
I don't know if it's a built-in command in the packer binary or if some external tools from macOS are called.

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

Not seeing anything obvious in the logs.

Going to do a packer with "keep_input_artifact": true

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

"keep_input_artifact": true
HFS+ filesystem
Packer Logs

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

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

Thanks. This really looks like a problem inside packer

2018/03/05 18:51:25 packer: 2018/03/05 18:51:25 Turning dir into box: /var/folders/5m/b4xyt3kj2sx8sbrksf0c6q0w0000gn/T/packer821802642 => windows_2016_docker_virtualbox.box
2018/03/05 18:51:25 packer: 2018/03/05 18:51:25 Compressing with gzip compression level: -1
2018/03/05 18:51:26 packer: 2018/03/05 18:51:26 Skipping directory '/var/folders/5m/b4xyt3kj2sx8sbrksf0c6q0w0000gn/T/packer821802642' for box 'windows_2016_docker_virtualbox.box'
2018/03/05 18:51:26 packer: 2018/03/05 18:51:26 Box add: '/var/folders/5m/b4xyt3kj2sx8sbrksf0c6q0w0000gn/T/packer821802642/Vagrantfile' to 'windows_2016_docker_virtualbox.box'
2018/03/05 18:51:26 ui: �[0;32m    virtualbox-iso (vagrant): Compressing: Vagrantfile�[0m
�[0;32m    virtualbox-iso (vagrant): Compressing: Vagrantfile�[0m
2018/03/05 18:51:26 packer: 2018/03/05 18:51:26 Box add: '/var/folders/5m/b4xyt3kj2sx8sbrksf0c6q0w0000gn/T/packer821802642/WindowsServer2016Docker-disk001.vmdk' to 'windows_2016_docker_virtualbox.box'
2018/03/05 18:51:26 ui: �[0;32m    virtualbox-iso (vagrant): Compressing: WindowsServer2016Docker-disk001.vmdk�[0m
�[0;32m    virtualbox-iso (vagrant): Compressing: WindowsServer2016Docker-disk001.vmdk�[0m
�[0;32m    virtualbox-iso (vagrant): Compressing: box.ovf�[0m
�[0;32m    virtualbox-iso (vagrant): Compressing: metadata.json�[0m
2018/03/05 18:56:09 packer: 2018/03/05 18:56:09 Box add: '/var/folders/5m/b4xyt3kj2sx8sbrksf0c6q0w0000gn/T/packer821802642/box.ovf' to 'windows_2016_docker_virtualbox.box'
2018/03/05 18:56:09 ui: �[0;32m    virtualbox-iso (vagrant): Compressing: box.ovf�[0m
2018/03/05 18:56:09 packer: 2018/03/05 18:56:09 Box add: '/var/folders/5m/b4xyt3kj2sx8sbrksf0c6q0w0000gn/T/packer821802642/metadata.json' to 'windows_2016_docker_virtualbox.box'
2018/03/05 18:56:09 ui: �[0;32m    virtualbox-iso (vagrant): Compressing: metadata.json�[0m
2018/03/05 18:56:09 [INFO] (telemetry) ending vagrant

The tar file is created internally: https://github.com/hashicorp/packer/blob/4d3a762e85e7e8050134a4e33e1f87a54029dcb8/post-processor/vagrant/util.go#L71-L155
but this function has no recent changes.

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

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?

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

There's one config option compression_level which can be set to 0 to turn off compression. Don't know if that makes a difference.

Issue with Golang or one of the imported packages?, maybe.
Maybe create a small golang program from the DirToBox function, removing the ui parameter and run it with some big files.

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.

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

@asbjornu With docker-compose you only can start containers on one Docker host. If you want to mix Linux and Windows workloads you need eg. Docker Swarm running a Linux and Windows node and then you can use a docker-compose.yml to deploy a stack.

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.

from packer-windows.

asbjornu avatar asbjornu commented on September 2, 2024

@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.

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.

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.

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

The workaround for now: Use Packer 1.1.3

I just rebuilt a VirtualBox box file (brew switch packer 1.1.3) and everything looks fine:

$ tar tvf windows_2016_docker_virtualbox.box 
-rw-r--r--  0 501    20        2286 Mar 11 14:27 Vagrantfile
-rw-r--r--  0 501    20 10952051712 Mar 11 14:27 WindowsServer2016Docker-disk001.vmdk
-rw-r--r--  0 501    20       10412 Mar 11 14:27 box.ovf
-rw-r--r--  0 501    20          26 Mar 11 14:27 metadata.json
~/code/packer-windows on my*
$ ls -l *box
-rw-r--r--  1 stefan  staff  10817278351 Mar 11 14:28 windows_2016_docker_virtualbox.box

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

Created golang/go#24599 for further investigation.

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

Everything from brew works for me now. Just adding the below for work around(?) until the golang people find the fix.

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.3
BuildVersion:	17D102
$ packer --version
1.2.2
$ go version
go version go1.10 darwin/amd64

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

@basictheprogram Your fix/workaround includes using the homebrew GNU tar and replacing the embedded tar in Vagrant?

from packer-windows.

basictheprogram avatar basictheprogram commented on September 2, 2024

@StefanScherer Nope. I think something changed in packer 1.2.2 from homebrew.

from packer-windows.

StefanScherer avatar StefanScherer commented on September 2, 2024

Weird. But as long as it works for you.
It will be officially fixed with Packer 1.2.3, PR hashicorp/packer#6084 got merged.
So using Packer 1.1.3 or 1.2.3 fixes the problem.

from packer-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.