Endless local network connections on Windows 7
Hi, I am trying to use vmfest on Windows 7 and Oracle/Hotspot 1.7.0_25-b17, 64 bit.
Here is the project.clj I use:
(defproject vmfest-1 "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[vmfest "0.3.0-alpha.5"]
[org.clojars.tbatchelli/vboxjws "4.2.4"]
;; [org.clojars.tbatchelli/vboxjxpcom "4.2.4"]
[ch.qos.logback/logback-classic "1.0.1"]
[ch.qos.logback/logback-core "1.0.1"]]
:jvm-opts ["-Dvbox.home=C:/Program Files/Oracle/VirtualBox"]
:main main)
The corresponding main.clj:
(ns main
(:use [vmfest.manager])
(:use [vmfest.virtualbox.image :only [setup-model]]))
Having done lein deps I do lein repl in a shell (cmd.exe):
C:\path\to\my\project>lein repl
nREPL server started on port 53262 on host 127.0.0.1
REPL-y 0.2.1
Clojure 1.5.1
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
main=> (def my-server (server "http://localhost:18083"))
#'main/my-server
main=>
main=> (models)
(:debian-6.0.2.1-64bit-v0.3)
main=>
main=> (def my-machine (instance my-server "my-vmfest-vm" :debian-6.0.2.1-64bit-
v0.3 :micro))
12:43:42.509 [nREPL-worker-2] INFO vmfest.manager - Instantiating VM with image
: {:os-type-id "Debian_64", :sudo-password "vmfest", :no-sudo false, :username "
vmfest", :os-family :debian, :os-version "6.0.2.1", :uuid "C:\\Users\\c-vilsva\\
.vmfest/models\\vmfest-debian-6.0.2.1-64bit-v0.3.vdi", :os-64-bit true, :passwor
d "vmfest", :description "Debian 6.0.2.1 (64bit) v0.3"} hardware: {:cpu-count 1,
:network [{:host-only-interface "vboxnet0", :attachment-type :host-only} {:atta
chment-type :nat}], :storage [{:devices [nil nil {:device-type :dvd} nil], :name
"IDE Controller", :bus :ide}], :boot-mount-point ["IDE Controller" 0], :memory-
size 512}
12:43:42.526 [nREPL-worker-2] INFO vmfest.virtualbox.virtualbox - create-machin
e: Creating machine my-vmfest-vm in C:\Users\c-vilsva\.vmfest\nodes/vmfest\my-vm
fest-vm\my-vmfest-vm.vbox, overwriting previous contents
12:43:42.539 [nREPL-worker-2] DEBUG vmfest.virtualbox.machine-config - Configuri
ng network for machine my-vmfest-vm with [{:host-only-interface "vboxnet0", :att
achment-type :host-only} {:attachment-type :nat}]
12:43:42.544 [nREPL-worker-2] DEBUG vmfest.virtualbox.machine-config - Configuri
ng adapter 0 with {:host-only-interface "vboxnet0", :attachment-type :host-only}
12:43:42.546 [nREPL-worker-2] DEBUG vmfest.virtualbox.machine-config - configure
-adapter: Configuring network adapter for machine 'my-vmfest-vm' slot 0 with {:h
ost-only-interface "vboxnet0", :attachment-type :host-only}
12:43:46.252 [nREPL-worker-2] WARN vmfest.virtualbox.machine-config - Trying to
configure a network adapter with inexistent host interface named vboxnet0 for m
achine my-vmfest-vm
12:43:46.254 [nREPL-worker-2] WARN vmfest.virtualbox.host - Creating a new Host
Only network interface
12:43:50.559 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #19
12:43:50.561 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #19 for deletion
12:43:53.177 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #20
12:43:53.179 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #20 for deletion
12:43:59.734 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #21
12:43:59.737 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #21 for deletion
12:44:10.627 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #22
12:44:10.629 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #22 for deletion
12:44:19.901 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #23
12:44:19.903 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #23 for deletion
12:44:26.176 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #24
12:44:26.178 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #24 for deletion
12:44:32.695 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #25
12:44:32.697 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #25 for deletion
12:44:40.497 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #26
12:44:40.499 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #26 for deletion
12:44:48.085 [nREPL-worker-2] INFO vmfest.virtualbox.host - Created Host Only n
etwork interface VirtualBox Host-Only Ethernet Adapter #27
12:44:48.088 [nREPL-worker-2] WARN vmfest.virtualbox.host - Scheduling host-onl
y interface VirtualBox Host-Only Ethernet Adapter #27 for deletion
12:45:01.611 [nREPL-worker-2] DEBUG vmfest.virtualbox.conditions - formatting ex
ception {:type :connection-error}
CompilerException clojure.lang.ExceptionInfo: throw+: {:message "unable to close
session", :type :connection-error, :full-message "unable to close session: HTTP
transport error: java.net.ConnectException: Connection refused: connect", :caus
e #<ClientTransportException com.sun.xml.internal.ws.client.ClientTransportExcep
tion: HTTP transport error: java.net.ConnectException: Connection refused: conne
ct>} {:object {:message "unable to close session", :type :connection-error, :ful
l-message "unable to close session: HTTP transport error: java.net.ConnectExcept
ion: Connection refused: connect", :cause #<ClientTransportException com.sun.xml
.internal.ws.client.ClientTransportException: HTTP transport error: java.net.Con
nectException: Connection refused: connect>}, :environment {exception #<ClientTr
ansportException com.sun.xml.internal.ws.client.ClientTransportException: HTTP t
ransport error: java.net.ConnectException: Connection refused: connect>, optiona
l-keys {:message "unable to close session"}, message "unable to close session",
full-message "unable to close session: HTTP transport error: java.net.ConnectExc
eption: Connection refused: connect"}}, compiling:(form-init5117612896395866539.
clj:1:17)
main=>
The final "CompilerException" was due to me closing down my running instance of vboxwebsrv. What happens is that I see an endless amount of network interfaces being created. First time this happened I did not realize what was going on before I had over 40 network connections configured in VirtualBox. If I open up the virtualbox gui and use File -> Preferences -> Network I see countless "Virtualbox Host-Only Ethernet Adapter #X" (where X is a number from 1 upwards) and one "Virtualbox Host-Only Ethernet Adapter" (that is, without the number suffix). In all my appempts vmfest (or whatever is doing this) has not stopped producing network adapters and moved on to actually being usable.
This is an issue created by vmfest making the assumption that host-only interfaces are named the same on all host platforms, which is almost the case except for Windows. What's happening is that VMFest is trying to be helpful and create the a host-only interface for you, named "vboxnet0", but it fails because when it checks if the right interface was created, it doesn't find it, as the new interface is named "Virtualbox Host-Only Ethernet Adapter #0" instead. This is complicated by the fact that you cannot dictate the name of the newly created interface. This needs a fix obviously.
In the meantime, a workaround is to tell vmfest to use a different host-only interface. By default the machine definitions are in vmfest.manager/machine-models
so before issuing the 'instance' call, issue:
(alter-var-root #'vmfest.manager/*machine-models*
(constantly
{:micro
{:memory-size 512
:cpu-count 1
:io-apic-enabled? true
:network [{:attachment-type :host-only
:host-only-interface "VirtualBox Host-Only Ethernet Adapter #0"}
{:attachment-type :nat}]
:storage [{:name "IDE Controller"
:bus :ide
:devices [nil nil {:device-type :dvd} nil]}]
:boot-mount-point ["IDE Controller" 0]}})
which is basically the existing contents except that it references the host-only interface by a different (windows compatible) name.
Let me know if this helps
Thank you, I will try to use this and report on my progress. I can see you have already highlighted this issue in #59 ; do not know why I did not see that before.
I tried your fix and it seems to have worked. I managed to work through the "play"-tutorial in vmfest-playground using the model you defined. One thing - I used "VirtualBox Host-Only Ethernet Adapter" (without the traling number) since that was the very first virtual network adapter on my machine. This ended up giving all my five machines (as per the last instructions in the "play" example) the same IP-number:
main> (pmap get-ip my-machines)
("10.0.3.15" "10.0.3.15" "10.0.3.15" "10.0.3.15" "10.0.3.15")
...since they seem to have failed DHCP discovery after repeated attempts (something I saw in their logs). I will try to go through the same exercise again after I have cleaned out some of the superfluous (and disabled) network adapters on my system.
You might have to setup the dhcp server in your "VirtualBox Host-Only Ethernet Adapter". I thought this was done by default.
On Sep 17, 2013, at 7:44 AM, Ville Svärd [email protected] wrote:
I tried your fix and it seems to have worked. I managed to work through the "play"-tutorial in vmfest-playground using the model you defined. One thing - I used "VirtualBox Host-Only Ethernet Adapter" (without the traling number) since that was the very first virtual network adapter on my machine. This ended up giving all my five machines (as per the last instructions in the "play" example) the same IP-number:
main> (pmap get-ip my-machines) ("10.0.3.15" "10.0.3.15" "10.0.3.15" "10.0.3.15" "10.0.3.15")
...since they seem to have failed DHCP discovery after repeated attempts (something I saw in their logs). I will try to go through the same exercise again after I have cleaned out some of the superfluous (and disabled) network adapters on my system.
— Reply to this email directly or view it on GitHub.
Antoni Batchelli Founder palletops.com
- twitter: @tbatchelli , @disclojure --- email: [email protected] ----- web: tbatchelli.org , disclojure.org
You are right, DHCP was not enabled
How did you expect it to be configured by default?
This is how VMFest configures it by default:
Server addres: 192.168.56.100 Server mask: 255.255.255.0 Lower Address Bound: 192.168.56.101 Upper Address Bound: 192.168.56.254
On Sep 17, 2013, at 11:49 AM, Ville Svärd [email protected] wrote:
How did you expect it to be configured by default?
— Reply to this email directly or view it on GitHub.
Antoni Batchelli Founder palletops.com
- twitter: @tbatchelli , @disclojure --- email: [email protected] ----- web: tbatchelli.org , disclojure.org