Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Add VirtualBox 5 support #373

Closed

Conversation

hheimbuerger
Copy link

Some improvements to make boot2docker more compatible with VirtualBox 5.

There's still some issues, e.g. that you have to create the exact expected host-only network yourself to make boot2docker-cli pick it up without issues.
But at least this allowed me to bootstrap a boot2docker VM on Windows 10 with VirtualBox 5 (VBox4 doesn't work very well on Windows 10, specifically no host-only networks).

I don't think this a PR ready for merging right away. I've never wrote any go before and didn't set up a proper dev environment either. I just did the minimum steps to get a boot2docker VM up and running. But I figured I might still submit this, maybe there's something useful for you in here.

PS: I know you consider boot2docker-cli deprecated, but docker-machine has the same issues with VirtualBox 5 and its dev environment requires to have docker already running, which was a hen and egg problem for me.

…because the former is only valid against a running VM.

I'm not sure how/whether this ever worked, maybe controlvm was valid on stopped VMs in VirtualBox 4.x or something else happened to start the VM in between (which I doubt, because then "boot2docker init" vs. "boot2docker up" doesn't make sense anymore).
…ed to have created exactly this host-only network with the VBox GUI before running init.
@hheimbuerger hheimbuerger changed the title Add virtualbox5 support Add VirtualBox 5 support Jul 12, 2015
@hheimbuerger
Copy link
Author

Note that the VM this currently creates has 8 CPUs and 2048 MiB base memory, both of which are probably a bit excessive.

It also only allocates 8 MiB of video memory, while VirtualBox complains that it needs at least 12.

For now, I'm just taking care of these issues manually with the VBox GUI.

@@ -658,7 +658,7 @@ func (m *Machine) Modify() error {
"--cpuhotplug", m.Flag.Get(F_cpuhotplug),
"--pae", m.Flag.Get(F_pae),
"--longmode", m.Flag.Get(F_longmode),
"--synthcpu", m.Flag.Get(F_synthcpu),
//"--synthcpu", m.Flag.Get(F_synthcpu),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove before merging?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, probably a good idea.

@jmorganca
Copy link

This fixed VBox 5 issues for me. Thanks for this PR!

  • See GH comments
  • Squash commits and sign it off see this

I've added some notes.

@hheimbuerger
Copy link
Author

Did it also create a VM with the maximum available CPUs and huge memory requirements for you?

@hheimbuerger
Copy link
Author

Something's not right yet. I regularly have VMs which error out during boot (so I have to recreate them with boot2docker-cli) and right now, I can't manage to have the docker client connect into a fresh VM anymore.

An error occurred trying to connect: Get https://192.168.59.104:2376/v1.19/containers/json: dial tcp 192.168.59.104:2376: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

@hheimbuerger
Copy link
Author

It stopped mounting the user directory as a shared folder (even though there's no error and it's not aborting when running boot2docker-cli). I suspect that's part of the problem. I'm getting lots of errors during boot now, for example:

sysctl: cannot stat /proc/sys/net/ipv6/conf/all/forwarding: No such file or directory
sysctl: setting key "cannot stat %s": No such file or directory
sysctl: "cannot stat %s" is an unknown key
sysctl: setting key "cannot stat %s": No such file or directory
Segmentation fault

and

Calling ioctl() to re-read partition table
partprobe: error while loading shared libraries: libdevmapper.so.1.02: cannot open shared object file: No such file or directory

and

[[1;32mSetting hostname to [[1;35mboot2docker[[0;39m [[1;32mDone.[[0;39m
mv: can't rename '/usr/local/etc/ssh/ssh_config.example': No such file or directory
mv: can't rename '/usr/local/etc/ssh/sshd_config.example': No such file or directory
grep: /usr/local/etc/ssh/sshd_config: No such file or directory

@hheimbuerger
Copy link
Author

The cause of my connection problems was local routes and is now fixed.

The above errors (including the segfault) do still occur in the boot2docker VM. Not sure if that's VBox5-specific or if they are normal to occur in 1.7.0 (but segfaulting always feels wrong).

@jmorganca
Copy link

I'll give it another go to try - sorry for the delay!

@hheimbuerger
Copy link
Author

Now I'm having my shared folders syncing incompletely (symptom: a simple text file opens fine with vi inside the boot2docker VM, but the last 20 characters are missing when reading the same file with cat), so this is definitely not ready for primetime yet.

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.

4 participants