Skip to content

Instantly share code, notes, and snippets.

@nyarla
Last active June 22, 2016 09:38
Show Gist options
  • Save nyarla/5698606 to your computer and use it in GitHub Desktop.
Save nyarla/5698606 to your computer and use it in GitHub Desktop.
(OBSOLETED) This code is no longer maintenance: Vagrant + Ubuntu 12.04 + Kernel 3.8.X + docker 0.3.4

Enviroments

  • Host:
    • Mac mini late 2012
    • OSX Mountain Lion 10.8.3
    • Vagrant 1.2.1 + VMware Fusion Provider
    • VMware Fusion 5.0.3
  • VM:
    • Ubuntu 12.04

1. vagrant up --provider=vmware_fusion

$ cd ~/ops/docker
$ git clone https://github.com/thoward/docker-vagrant.git docker
$ cd docker
$ librarian-chef install
$ vagrant up --provider=vmware_fusion

2. get vmware-tools for linux tarball

  1. download vmware-tools archive
  1. untar && unzip
  2. mount payload/linux.iso
  3. get vmware-tools-{version}-{number}.tar.gz

3. send vmware-tools tarball to vm

  1. put vmware-tools tarball to vagrant synced dir
  2. copy vmware-tools tarball form /vagrant dir in vm

4. install 3..8.x kernel && header (Ubuntu 12.04)

$ vagrant ssh
--- in ubuntu 12.04 (vagrant vm)
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ exit
--- in your host
$ vagrant reload

5. symlink version.h

--- in ubuntu 12.04
$ sudo ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

6. re-install vmware-tools

6.0 extract source code

--- in ubuntu 12.04
$ cd ~/tmp # for example
$ tar zxvf VMwareTools-9.2.2-893683.tar.gz
$ cd vmware-tools-distrib

6.1 patch to vmhgfs.tar

$ cd lib/modules/source
$ tar xvf vmhgfs.tar
$ vim vmhgfs-only/inode.c

--- before: line 888
result = compat_vmtruncate(inode, newSize);
--- after:
result = 0;

$ tar cf vmhgfs.tar vmhgfs-only/
$ rm -rf vmhgfs-only

6.2 patch to vmci.tar

$ tar xvf vmci.tar
$ bim vmci-only/linux/driver.c

--- before: line 127
.remove = __devexit_p(vmci_remove_device)
--- after:
.remote = vmci_remove_device

--- before: line: 1753
static init __devinit vmci_probe_device( ...
--- after:
static int vmci_prove_device( ...

--- before: line: 1981
static void __devexit vmci_remove_device( ...
--- after:
static void vmci_remove_device( ...

$ tar cf vmci.tar vmci-only
$ rm -rf vmci-only/

6.3 install

$ cd ~/tmp/vmware-tools-distrib
$ sudo ./vmware-install.pl

7. That's All!

$ cd ~/ops/docker/docker
$ vagrant reload
$ vagrant ssh
--- in ubuntu 12.04
$ docker version

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment