Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Proper VMware support #747

Merged
merged 5 commits into from Apr 17, 2015
Merged

Proper VMware support #747

merged 5 commits into from Apr 17, 2015

Conversation

frapposelli
Copy link
Contributor

As mentioned in #638 and #659 this PR adds support for VMware Tools in the most comprehensive manner given the current limitation of TCL 5.x.

Features:

  • Add vmtoolsd for backdoor communication with the hosting hypervisor.
  • The open-vm-tools build is embedded in the Dockerfile (no longer tied to vmware/tcl-container).
  • A wrapper for the shutdown command, to gracefully shutdown and reboot the GOS when issuing commands using tools.
  • Memory balloon kernel module (vmw_balloon).
  • A slightly modified automount script that verifies if the disk is provided by a VMware hypervisor, throughly checks if empty and formats it for use with B2D.

Missing:

  • Shared Folders (vmhgfs) support as we need 64bit userspace and kernel to make it work (will follow up with a PR on that too).

Fixes #638 and #659

References:
docker/machine#507
docker/machine#532
docker/machine#461
docker/machine#430

@SvenDowideit
Copy link
Contributor

cool! how big does this make the iso?

and have you had a chance to test it with the 64 bit work from @afressancourt ?

@romant
Copy link

romant commented Feb 19, 2015

+1

@frapposelli
Copy link
Contributor Author

@SvenDowideit size has not increased much:

$~ ls -al boot2docker.iso
-rw-r--r--  1 frapposelli  staff  25165824 Feb 19 11:31 boot2docker.iso

And yes, I have a 64 bit working install based on @afressancourt work that has everything including shared folders support, is there a 64 bit branch I can send that PR to?

@afressancourt
Copy link
Contributor

Hello Fabio,

Do you have the Dockerfile somewhere that I could build upon in parallel of the pullrequest process? Thanks a lot, and congratulations, I am struggling with shared folder support and acpid since the beginning of the week !

@frapposelli
Copy link
Contributor Author

@afressancourt I need to do some merging before pushing the branch to github but I'll update you once it's there.

BTW, when I say everything working including shared folders support it's in regard to the scope of this PR so VMware Tools, I haven't played with it on Virtualbox 😄

@afressancourt
Copy link
Contributor

My own pull request
#748

@frapposelli
Copy link
Contributor Author

@SvenDowideit @tianon have you guys had the chance to review this?

@@ -0,0 +1,8 @@
#!/bin/sh
# just to make open-vm-tools happy, nad fake output

This comment was marked as spam.

@SvenDowideit
Copy link
Contributor

yeah, LGTM - though I've not had a system setup to test it. @tianon ?

@tianon
Copy link
Contributor

tianon commented Feb 23, 2015

... (no longer tied to vmware/tcl-container).

We still are though, right? (since we're downloading resources from that repo)

I wasn't opposed to keeping that built externally especially since it keeps the diff here down to just the elements that matter for boot2docker explicitly, and I trust you guys to maintain it appropriately.

The approach here seems reasonably sane, although adding the full build here has turned it into a bit of a patch-bomb. 😄

Showing 8 changed files with 754 additions and 2 deletions.

@frapposelli
Copy link
Contributor Author

@tianon on the ties to vmware/tcl-container, I will refactor it a bit and make it rely on a single patch file, I'd rather keep the build process as part of boot2docker, it is easier to maintain for us in the long run 😄

@tianon
Copy link
Contributor

tianon commented Feb 23, 2015

Heh OK, that's fair. 👍

Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
- fake a lsb_release script to make open-vm-tools happy
- start vmtoolsd on boot
- add shutdown script wrapper for busybox

Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
@frapposelli
Copy link
Contributor Author

Here it is, bundled the patches and did some general cleanup, most of the LOC come from the network script that we added 😉

RUN mkdir -p /vmtoolsd && cd /vmtoolsd && \
curl -L -o open-vm-tools-$OVT_VERSION.tar.gz http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-$OVT_VERSION.tar.gz && \
tar xfz open-vm-tools-$OVT_VERSION.tar.gz && rm open-vm-tools-$OVT_VERSION.tar.gz &&\
mv open-vm-tools-$OVT_VERSION open-vm-tools

This comment was marked as spam.

This comment was marked as spam.

@frapposelli
Copy link
Contributor Author

Alright, spit and polish all around, should be ready for prime time this time 😄

@tianon
Copy link
Contributor

tianon commented Feb 27, 2015

LGTM

How hard will it be to port to a proper 64bit userspace?

@frapposelli
Copy link
Contributor Author

@tianon has been done already 😄 I have a branch running at https://github.com/frapposelli/boot2docker/tree/vmware-64bit based on the work made by @afressancourt

It's actually better as it supports shared folders (can't make them work with the current 64bit kernel/32bit userspace situation).

@md5
Copy link
Contributor

md5 commented Feb 27, 2015

It's actually better as it supports shared folders (can't make them work with the current 64bit kernel/32bit userspace situation).

🙌

@frapposelli
Copy link
Contributor Author

I just realized I left out an important bit from the auto mount script, need to fix it before merging.

- Embed patch to network suspend/resume script and removed file
- Fix `$()` in automount
- Added comments to `vmtoolsd` startup script
- Small tweaks in Dockerfile

Signed-off-by: Fabio Rapposelli <fabio@vmware.com>
@frapposelli
Copy link
Contributor Author

Fixed the automount script, forgot that we have a different SCSI VID and PID in ESX :-).

Tested with Fusion, Workstation, Player and ESX, so LGTM :-)


DISK_VENDOR=$(cat /sys/class/block/$(basename $UNPARTITIONED_HD /dev/)/device/vendor /sys/class/block/$(basename $UNPARTITIONED_HD /dev/)/device/model | tr -d "\n")
# Test if disk is "VMware, VMware Virtual S" and empty.
if [ "$DISK_VENDOR" = "VMware, VMware Virtual S" ] || [ "$DISK_VENDOR" = "VMware Virtual disk " ]; then

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dreampuf
Copy link

I'm exciting to see this PR get merge for shared folder feature.
Thank you for great job !

@weikinhuang
Copy link

Has there been any updates on this?

@dizzyd
Copy link

dizzyd commented Apr 7, 2015

bump :)

@mikeys
Copy link

mikeys commented Apr 8, 2015

Wondering about this myself... Currently it's very difficult to utilise boot2docker in development environment due to the slowness of VirtualBox's shared folders implementation.

@tianon
Copy link
Contributor

tianon commented Apr 13, 2015

Ok, this LGTM now; I'm planning to merge as soon as 1.6 is finished and released.

@frapposelli
Copy link
Contributor Author

Great, thanks @tianon !

@tianon
Copy link
Contributor

tianon commented Apr 17, 2015

Hey thanks for the poke @frapposelli, and sorry we were already committed and frozen for 1.6 😞. Onward to merge, though!

tianon added a commit that referenced this pull request Apr 17, 2015
@tianon tianon merged commit a142bc9 into boot2docker:master Apr 17, 2015
@md5
Copy link
Contributor

md5 commented Apr 17, 2015

🎉

@cmluciano
Copy link

Are there any docs for using this within boot2docker? I tried changing my driver using boot2docker config to no avail.

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

Successfully merging this pull request may close these issues.

None yet