 			when 'hostonly'
 				actions.push do (vm, adaptor, index) ->
 					(callback) ->
+						return callback new Error "no network specified for adaptor" if not adaptor.network?
+						
 						network.set_hostonly vm, index, adaptor.network, callback
 						
 			when 'internal'
 				actions.push do (vm, adaptor, index) ->
 					(callback) ->
+						return callback new Error "no network specified for adaptor" if not adaptor.network?
+						
 						network.set_internal vm, index, adaptor.network, callback
 						
 			when 'nat'

	
	configure_dhcp = (nn, nc, add_dhcp, modify_dhcp) ->
		(callback) ->
			dhcp.list_servers (err, servers) ->
				return callback err if err
				
				s = servers.reduce (previous, current) ->
					return previous if previous and previous.NetworkName == nn or previous.NetworkName == "HostInterfaceNetworking-#{nn}"
					return current if current and current.NetworkName == nn or previous.NetworkName == "HostInterfaceNetworking-#{nn}"
					
				h = () ->
					s.IP != nc.ip or

					 add_dhcp nn, nc.ip, nc.netmask, nc.dhcp.lower_ip, nc.dhcp.upper_ip, callback
					 
	for netname, netconfig of config.network.hostonly
		actions.push do (netname, netconfig) ->
			(callback) ->
				network.list_hostonly_ifs (err, ifs) ->
					return callback err if err
					
					i = ifs.narrow (previous, current) ->
						return previous if previous and previous.Name == netname
						return current if current and current.Name == netname
						
					if not i
						callee = arguments.callee
						
						network.create_hostonly_if (err) ->
							return callback err if err
							
							network.list_hostonly_ifs callee
					else
						if i.IP != netconfig.ip or s.i.NetworkMask != netconfig.netmask
							network.configure_hostonly_if netname, netconfig.ip, netconfig.netmask, callback
						else
							return do callback if callback
							
		if netconfig.dhcp?
			actions.push do (netname, netconfig) ->
				configure_dhcp netname, netconfig, dhcp.add_hostonly_server, dhcp.modify_hostonly_server
