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

host only interface / dynamic IP with fixed hostname#198

Closed
aheissenberger wants to merge 3 commits into
boot2docker:masterfrom
aheissenberger:feature/pull/host-only-interface
Closed

host only interface / dynamic IP with fixed hostname#198
aheissenberger wants to merge 3 commits into
boot2docker:masterfrom
aheissenberger:feature/pull/host-only-interface

Conversation

@aheissenberger

Copy link
Copy Markdown
Contributor
  • creates a host only network in virtual box if not exist
  • will ask to modify if a network exists which does not use the defined settings
  • add a second interface to the VM with a host_only network - needs fix busy box dhcp bug which will result in an empty /etc/resolv.conf #197 to work!
  • updates DOCKER_HOST in .bash_profile
  • updates docker in /etc/hosts with the actual IP of the docker daemon on the host only network

REQUIRES BASH to work!

will ask for your docker vm user password if you not placed your public keys in the VM on every start to validate the current IP.

this implements the requirements of #93 except for _not offering a static IP - this allows to have multiple VMs to use the same host only network and talk to each other._

add DOCKER_HOST to .bash_profie
add host only ip to /etc/hosts
Comment thread boot2docker Outdated

This comment was marked as spam.

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@maelp what system do you use and is your user allowed to sudo?

@maelp

maelp commented Feb 22, 2014

Copy link
Copy Markdown

osX 10.9, it happens just after I do a boot2docker up and I enter the tcuser password, then it asks me for my osX password, and it gives me an error

@aheissenberger

Copy link
Copy Markdown
Contributor Author

can you run it with bash -x boot2docker up to get the exact line where thescript fails

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@maelp can you try it again with the last patch

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@steeve @SvenDowideit do you want to go this way?

@maelp

maelp commented Feb 25, 2014

Copy link
Copy Markdown

@aheissenberger I get

sed: 1: "'/docker/d'": invalid command code '
/Users/primet/bin/boot2docker: line 401: mod_profile: command not found
[2014-02-25 15:57:50] Started.

@maelp

maelp commented Feb 25, 2014

Copy link
Copy Markdown

Docker seems to work then, but the command does not open the port 8080 on osX or mount my /tmp folder

bash ./boot2docker cmd run -i -t -p 8080:8080 -v /tmp:/tmp ubuntu /bin/bash

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@maelp this will only work if you use my modified ISO from my fork which includes the needed changes. nfs client is only available in the master but not in the released ISO

@maelp

maelp commented Feb 25, 2014

Copy link
Copy Markdown

@aheissenberger I downloaded the latest ISO from your release page

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@maelp I will do a check - please post any further results here:
aheissenberger#5

this is the wrong repository to discuss this

@SvenDowideit

Copy link
Copy Markdown
Contributor

@aheissenberger I don't think so - we really would like to avoid baking nfs / sshfs / smb into boot2docker, as the -v /localhost:/container mounting is not really a sustainable thing

@steeve

steeve commented Feb 25, 2014

Copy link
Copy Markdown
Contributor

Well, as of #224 we do have NFS in boot2docker

@steeve

steeve commented Feb 25, 2014

Copy link
Copy Markdown
Contributor

Also, SMB (mount.cifs) is already included in TCL

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@SvenDowideit @steeve we need to find a common ground how shared folders should be handled - this pull request is only about offering a second interface which will allow to use hfs, smb

@SvenDowideit how do you think we should implement shared folders?

I personally still think this should be done by the docker client/server

@SvenDowideit

Copy link
Copy Markdown
Contributor

@aheissenberger from the talks I've had, sharing local data with the daemon at run time is something that will be implemented in docker itself, but someone needs to work out how to make it work well, and then to write the code :)

I do get the feeling that the solution will not be using live mounting ala nfs, but something that can scale to multiple containers, and over bad internet connections - so more like the build time context. (but IAMTM, and my opinion is just that.)

@steeve

steeve commented Feb 26, 2014

Copy link
Copy Markdown
Contributor

Somebody suggested we mount /Users in the VM. This is a pretty clever hack, and I think it should work nicely for the time being.

It also has the plus of being transparent (ie -v $HOME/projects/:/projects works) and is static (no need to intercept the docker call).

So I propose that init creates a 2nd host only interface, configures NFS for mounting /Users (on OSX) in the VM.

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@steeve I have done some more research and think it would be good to add the virtualbox kernel module to the VM. This will allow us to simple read the dynamic IP of the second interface:
VBoxManage guestproperty enumerate VM_NAME | grep "Net.*V4.*IP"
(more here https://www.virtualbox.org/ticket/9969)

and adding only the kernerl module should not make the ISO so much bigger:
here are some infos and a script to create the extension but maybe we can build it directly into the kernel
http://forum.tinycorelinux.net/index.php/topic,12839.msg71468.html?PHPSESSID=fn92igu8155q6bpfnkg6l2huq3#msg71468

additional this will give us a very nice interface for any kind of data exchange by using VBoxManage guestproperty get/set and we wont have to use ssh

@steeve

steeve commented Feb 28, 2014

Copy link
Copy Markdown
Contributor

Well, the issue is that boot2docker-cli is on the verge of supporting other providers than VBox (namely VMware and Hyper-V). What happens when we do?

I think we need to find a solution that is generic enough. Be it ssh or something else.

@SvenDowideit

Copy link
Copy Markdown
Contributor

I'm pondering this at the moment too - either I need to add a go based ssh-client to boot2docker-cli (so it can be scripted without the user needing to see: very :( ), (We dont' get things like expect on windows)

or I go left, far left

and add something like a fingerd, that outputs the setting info that we want.

@tianon @steeve @aheissenberger can you think of something simpler?

@steeve

steeve commented Feb 28, 2014

Copy link
Copy Markdown
Contributor

All in all, I'm 👎 for adding VBox modules.
Also, let's have this discussion in boot2docker/boot2docker-cli#42 since boot2docker-cli is the future.

@SvenDowideit

Copy link
Copy Markdown
Contributor

we implemented this in https://github.com/boot2docker/boot2docker-cli - awesome

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