Page 1 of 1
Technical linux vs. host interfaces question
Posted: 17. Dec 2008, 15:05
by polki
Hi guys,
got no problem with virtualbox, just don't know how to get the setup done the way i want it...

I wanna run my
router in virtualbox. I've stuffed the host with two network cards and done bridging eth0 to vbox0 etc. pp.
But, i'm not so happy with this config since i always think that with bridging eth0 is still available and usable within the host and not only within the virtualbox.
My virtualbox is configured to have two network interfaces, vbox0 is bridged to eth0 where the wan cable is plugged in, whereas vbox1 is bridged to eth1 so that other clients within the lan can access the internet.
Is there any possibility in Linux to forward everything on eth0 completely to vbox0 in a way that eth0 is not at all usable by the host anymore? The host got everythin it wants from within eth1...
Posted: 17. Dec 2008, 15:27
by polki
Ok, i just realised how weird and absolutely not understandable my explication of my problem ist...

So i draw a pic of the config i wish to have. I know the pic is not best either, my grandma could've probably made it better, but i think you get my problem from that.
So again my question: How do i have to configure my Linux host to match my config wishes?
Posted: 17. Dec 2008, 16:15
by greenpossum
Just don't assign an address to eth0 and be careful not to use it anywhere. See my writeup on how to install IPCop in VirtualBox:
http://greenpossum.awardspace.com/ipcop-in-vbox.html
Posted: 17. Dec 2008, 16:19
by polki
Thanks. That's exactly what i was searching for!!! My hero
Have used IPCop myself for quite some time, so it's no difficulty to transpose this to pfSense...
Thanks again!
Posted: 17. Dec 2008, 19:35
by polki
One quick question though about your shutdown script:
Isn't it possible to just use the
Code: Select all
VBoxManage controlvm <vm> savestate
command?
Posted: 18. Dec 2008, 02:38
by greenpossum
polki wrote:One quick question though about your shutdown script:
Isn't it possible to just use the
Code: Select all
VBoxManage controlvm <vm> savestate
command?
Yes, I think so. Is this the ACPI shutdown command? That should also work. Because I am used to running IPCop on machines predating ACPI, I didn't think of using ACPI to shutdown, but of course VirtualBox emulates a more modern motherboard.
Posted: 20. Dec 2008, 01:51
by Sasquatch
Depending on the Guest, you will either get a VM that shuts down, gives a shutdown dialog or does nothing at all. It seems that is depends on the OS that runs in the VM. Windows does a shutdown as it should, Linux Desktop (at least Ubuntu AFAIK) gives the shutdown dialog and Linux Server (also Ubuntu) does nothing. The last two could be due to a GUI or not that might catch the event.
Posted: 24. Feb 2009, 16:08
by polki
Just wanted to give you guys some feedback to work with regarding this topic...
I tried doing this with
Code: Select all
VBoxManage controlvm <vm> savestate
and it just works like a charm. This got nothing to do with ACPI or anything else since the VBox is not really shut down, it's just saved for later reexecution. The user manual of VirtualBox is writing the following:
VBoxManage controlvm <vm> savestate will save the current state of
the VM to disk and then stop the VM. (This is equivalent to selecting the “Close” item in the “VM” menu of the GUI or pressing the window’s close button, and then selecting “Save the machine state” in the dialog.)
After this, the VM’s state will be “Saved”. From there, it can be started again.
So I just tried it and it works out fine. I have my VMs started at startup and stopped on shutdown without any hassle. Best thing is that "savestate" works really fast (just some seconds) and runs synchronized so you don't have to manually insert some waiting time into the shutdown script.
If you got any more questions concerning this stuff, just ask...
IPCop & Samba Server
Posted: 24. Feb 2009, 19:23
by jobertel
Greenpossum, I am curious why you did not set up the Samba server as another virtual machine? My take on virtualiztion is that for a production setting, the host should have guest support as its only responsibility. I can see dhcp given your reason, but I don't know about other services.
John B.
Re: IPCop & Samba Server
Posted: 25. Feb 2009, 12:52
by polki
jobertel wrote:Greenpossum, I am curious why you did not set up the Samba server as another virtual machine? My take on virtualiztion is that for a production setting, the host should have guest support as its only responsibility. I can see dhcp given your reason, but I don't know about other services.
In theory you're right but I did it the same way as Greenpossum. An additional VM would mean additional load with no additional use at all. It would take more time to boot the machine, wasting more time until all needed services are up and running.
Additionally running Samba within a VM would make things too complex in my eyes. I like to have things flexible, that's why I picked running a RAID with LVM on top for my use. That gives me the flexibility to just throw in another disk and grow the raid as well as the filesystem and have more space available. Running Samba within a VM would just create problems since the VM-harddisks are not growable. So I'd have to build up another LVM within the VM, add another VM-harddisk for additional space and add it to the VM-LVM to get more space for Samba. You see where this is going... Making things too complex just to stick to theory is not my favorite...

LVM tips the arguement
Posted: 25. Feb 2009, 21:23
by jobertel
LVM makes sense for Samba. In fact my first attempt at using virtualbox I did not have LVM set up properly and the host disk space got 100% used in the middle of a guest upgrade. Re-imaged the whole pc with LVM and gained a lot of flexibility. (Moved to VB 2.1 in the process.)
It works beautifully now. Since the machine is only used for testing distro's and applications I have nearly nothing on the host. So far Win 7 is working fine as a guest.