Networking IP Address Issues : NetBSD on Xen VM

dhaneshk k dhaneshkk at hotmail.com
Tue Jul 3 07:04:09 UTC 2012



List,

Little bit offtopic of FreBSD, Hope some one can help with some suggestions..


The Objective is to
port NetBSD as a Virtual Machine into  Cloud.






Steps Involved in
Porting NetBSD as a Virtual Machine:





Porting of NetBSD as
a Virtual Machine involves 2 steps.


A. Porting NetBSD
w.r.t Virtualization



B. Porting NetBSD
w.r.t Cloud MiddleWare


If Step 1 is
completed successfully, then only Step2 could be proceeded.







A. Porting NetBSD
w.r.t Virtualization:




 
	We use Xen
Virtualization.Xen Virtualization involves the following steps.


Various methods are
available to port NetBSD as Virtual Machine in Xen





1. Building from ISO
( Via Paravirtualization - Using NetBSD community provided Kernel /
Full Virtualization - using Qemu )






2. Building the
NetBSD File System from the Source





We have tried both
the ways.







1.1 Building from ISO
( Via Paravirtualization - Using NetBSD community provided Kernel ):





1. Get the ISO file
of NetBSD Operating System .


2. Build the IMG
File from the ISO File by using NetBSD community provided Kernel 






Refer :
http://www.netbsd.org/ports/xen/howto.html






1.2 Building from ISO
( Via Full virtualization - Using Qemu):





Refer:
http://open.eucalyptus.com/wiki/creating-images-iso-xen


By following the
above Step, the following version of NetBSD Image was built.










Version



NetBSD
5.1





Kernel



XEN3_DOMU





Kernel
Version



NetBSD
netbsd51.yourdomain.org 5.1 NetBSD 5.1 (XEN3_DOMU) #0: Sat Nov 6
13:17:16 UTC 2010
builds at b6.netbsd.org:/home/builds/ab/netbsd-5-1-RELEASE/amd64/201011061943Z-obj/home/builds/ab/netbsd-5-1-RELEASE/src/sys/arch/amd64/compile/XEN3_DOMU
amd64





Architecture



amd64
/ 64 Bit Guest Virtual Machine








Working
Components :





The NetBSD Guest is
booted successfully in Multi User Mode, which enables root user to
create / delete files / directories.


The Network
Interface is xennet0



The File System
details are as follows.















Filesystem



Size



Used



Avail



%Cap



Mounted
on





/dev/xbd0a



9.5
GB



628
MB



8.4
GB



6%



/





kernfs



1.0K



1.0K



0B



100%



/kern





ptyfs



1.0K



1.0K



0B



100%



/dev/pts





procfs



4.0K



4.0K



0B



100%



/proc
















Issues Faced:





Unable to set IP
Address manually (or) via dhclient
command.



Even though static
IP Address is assigned, netmask,gateway

is set, the NetBSD Guest
Virtual Machine is unable to

 connect to outside Network; Machines in
outside network 

are also unable to connect to the NetBSD Guest
Virtual 

Machine .





Please shed some light on this, Why this issue occurs ?  Or  doing wrong way?






2. Building the
NetBSD File System and Kernel from the Source:







NetBSD Image could
be built by connecting to the NetBSD

 repository, download the Source
packages, compile and build

the Kernel and the NetBSD File System;
at last convert the

 NetBSD File System into a single Image via makefs
command.







I compiled 64 Bit
NetBSD Kernel and 64 Bit NetBSD File System.






B. Porting NetBSD
into Cloud MiddleWare:





Porting NetBSD into
Cloud Middleware involves bundling ,

 uploading and registering
Kernel, RamDisk and Machine Image

 into  Cloud.











The
NetBSD Image has been uploaded into cloud and a sample Virtual
Machine was run Successfully in our Cloud Setup (192.168.1.6).












Refer :


http://blog.netbsd.org/tnf/entry/netbsd_now_runs_under_amazon





By following this
procedure, the following version of NetBSD

 Image was built.










Version



NetBSD
6.99.8





Kernel



XEN3_DOMU





Kernel
Version



NetBSD
6.99.8 NetBSD 6.99.8 (XEN3_DOMU) #0: Fri Jun 29 21:55:59 IST 2012
root at pancdaccloud:/home/src/usr/obj/sys/arch/amd64/compile/XEN3_DOMU
amd64





Architecture



amd64
/ 64 Bit Guest Virtual Machine








Working
Components :





The Network
Interface is xennet0



IP Address was
obtained successfully via dhclient
command.






The NetBSD Guest
Virtual Machine is able to connect to

 outside Network; Machines in
outside network are also able

 to connect to the NetBSD Guest Virtual
Machine .














The File System
details are as follows.















Filesystem



Size



Used



Avail



%Cap



Mounted
on





root_device



255
MB



135
MB



107
MB



55%



/





tmpfs



1.4
MB



632
KB



840
KB



42%



/dev








Issues Faced:





1.The NetBSD Guest
is booted in Single User Mode, which

 disables root
user to create / delete files / directories.The

 Filesystem is mounted
in read-only
mode.

Why the box going to Single user mode? Am I doing wrong ?







Common Issues:





There are certain
places where Human Intervention is

 required.While NetBSD Virtual
Machine Guest is being

 booted, at first it asks for default
Interpreter (/bin/sh).At this

 situation, User is required to give a
value and press Enter

 Key.After getting input from the User, System
Services are

 getting booted. When the NetBSD Image is uploaded into


Cloud,the IP Address will always be shown as 0.0.0.0, and

 the User
is required to login to the Node Controller,Take a

 console of the
Virtual Machine, specify the Interpreter and

 run dhclient.But
in real time scenario,User logging into the

 Node Controller is
impossible.






Attempted Tasks:





The following
approach was also performed when building NetBSD Image.





In both the Cases,
all the files were mounted in / .






To reduce the size
of /, the following folders were mounted in different mount points.











Folder



Mount
Point





usr



/usr





tmp



/tmp





root



/root





home



/home








The Same problems
discussed here were faced.

Any hints to solve these issues much appreciated.

Thank you
Dhanesh 		 	   		  


More information about the freebsd-questions mailing list