New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host only interface / dynamic IP with fixed hostname #198

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@aheissenberger
Contributor

aheissenberger commented Feb 18, 2014

  • 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 #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._

aheissenberger added some commits Feb 18, 2014

create host only interface
add DOCKER_HOST to .bash_profie
add host only ip to /etc/hosts
Show outdated Hide outdated boot2docker
if [[ "$?" == "1" ]]; then
log "add '$BOOT2DOCKER_HOST_NAME $DOCKER_HOST_IP' to /etc/hosts"
MHD_HD_EXPORT_CMD="sudo sed -i.bak '/$BOOT2DOCKER_HOST_NAME/d' /etc/hosts; sudo echo \"$DOCKER_HOST_IP $BOOT2DOCKER_HOST_NAME\" >> /etc/hosts"

This comment has been minimized.

@maelp

maelp Feb 21, 2014

This fails when I run boot2docker up (says there is an error on the sed command, and does not add the line to /etc/hosts, probably because of permission)

@maelp

maelp Feb 21, 2014

This fails when I run boot2docker up (says there is an error on the sed command, and does not add the line to /etc/hosts, probably because of permission)

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 22, 2014

Contributor

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

Contributor

aheissenberger commented Feb 22, 2014

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

@maelp

This comment has been minimized.

Show comment
Hide comment
@maelp

maelp Feb 22, 2014

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

maelp commented Feb 22, 2014

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

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 22, 2014

Contributor

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

Contributor

aheissenberger commented Feb 22, 2014

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

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 25, 2014

Contributor

@maelp can you try it again with the last patch

Contributor

aheissenberger commented Feb 25, 2014

@maelp can you try it again with the last patch

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 25, 2014

Contributor

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

Contributor

aheissenberger commented Feb 25, 2014

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

@maelp

This comment has been minimized.

Show comment
Hide comment
@maelp

maelp Feb 25, 2014

@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 commented Feb 25, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@maelp

maelp Feb 25, 2014

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

maelp commented Feb 25, 2014

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

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 25, 2014

Contributor

@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

Contributor

aheissenberger commented Feb 25, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@maelp

maelp Feb 25, 2014

@aheissenberger I downloaded the latest ISO from your release page

maelp commented Feb 25, 2014

@aheissenberger I downloaded the latest ISO from your release page

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 25, 2014

Contributor

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

this is the wrong repository to discuss this

Contributor

aheissenberger commented Feb 25, 2014

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

this is the wrong repository to discuss this

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Feb 25, 2014

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

Contributor

SvenDowideit commented Feb 25, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Feb 25, 2014

Contributor

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

Contributor

steeve commented Feb 25, 2014

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

@steeve

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Feb 25, 2014

Contributor

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

Contributor

steeve commented Feb 25, 2014

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

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 26, 2014

Contributor

@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

Contributor

aheissenberger commented Feb 26, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Feb 26, 2014

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

Contributor

SvenDowideit commented Feb 26, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Feb 26, 2014

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.

Contributor

steeve commented Feb 26, 2014

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.

@aanand aanand referenced this pull request Feb 27, 2014

Closed

Fails on OSX #115

@aheissenberger

This comment has been minimized.

Show comment
Hide comment
@aheissenberger

aheissenberger Feb 28, 2014

Contributor

@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

Contributor

aheissenberger commented Feb 28, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Feb 28, 2014

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.

Contributor

steeve commented Feb 28, 2014

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

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit Feb 28, 2014

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?

Contributor

SvenDowideit commented Feb 28, 2014

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

This comment has been minimized.

Show comment
Hide comment
@steeve

steeve Feb 28, 2014

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.

Contributor

steeve commented Feb 28, 2014

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

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit May 30, 2014

Contributor

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

Contributor

SvenDowideit commented May 30, 2014

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

@SvenDowideit

This comment has been minimized.

Show comment
Hide comment
@SvenDowideit

SvenDowideit May 30, 2014

Contributor

done in b2d-cli

Contributor

SvenDowideit commented May 30, 2014

done in b2d-cli

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