I know that this topic has been discussed all over the internet for a few years now, especially since ubuntu became that popular. There are a lot of great comments and thoughts out there on what linux is and what it isnt, and especially on what it tries to be. But some weeks ago I got a comment on my post “setting up a bridged network for virtualbox on ubuntu linux” which I can’t leave uncommented:
Appreciate the effort and answers but ….
this is exactly the type of thing that will keep linux/ubuntu from ever achieving a significant portion of the mqarket. As long as users have to spend a day searching and patching every application that was not built into the OS distribution then the OS will never make it to the mainstream and it will remain in the realm of hakers, nerds and others that have more time than money.
First of all I am a little bit offended by that. I actually have loads of money and no time at all, if I do something with my linux boxes, then because I choose to do so (some people might call that a hobby). I only have the time to write this comment, since I’m home sick and can’t go to work. And second of all: The Commenter is just so plain wrong, that I can’t say nothing to it (it’s definitely a duty call)! He may be right in one thing though: gnu/linux (any of its various distributions) will never achieve a significant portion of the market. (But hey: who knows!?) But the question here is: who said linux ever wanted to do such a thing. As far as I remember no one ever claimed that portion for linux! Why is that? Well, this is an easy one: nobody is even able to claim a significant portion of the market, because linux itsself leaves you the freedom of choice, so linux will certainly claim for nothing (eventhough it could for a lot!). It’s as simple as that: Take it or leave it!
The one thing people still don’t understand is that linux won’t replace windows, it’s an alternative! The magic about it, is that it does what you want it to do and becomes what you want it to become. There are just so many scenarios in which a running gnu/linux does just plain different things. And the most important things about gnu/linux are the evaluation it takes, the freedom it spreads and the people behind it. But it won’t just replace windows! It’s different. I won’t count the various advantages of linux and disadvantages of windows (in my point of view, for the gamer it’s quite the opposite), but as the author of the comment above pointed out: if all “hackers” and “nerds” are using it, it’s gotta have something. I know there are various scopes with various arguments for and against an operating system, so there is no universal answere. Also there is still a lot left to say, but I’m sick and tired of everyone comparing linux to windows and other systems. The discussion is old and boring. Besides: there is no need for any kind of discussion. Any user, if it’s windows, mac, *nix or whatsoever doesn’t need to justify his choice of OS, because it’s his choice, and not a one someone else should make for him!
Decide for yourself, but never complain about what linux is and what it isn’t, because in the end it’s just what you want it to be!
Just right now I’m setting up my new home server for various things. It’ll do all of my ranking stuff of course, since it’s very easy for me to get a new ip once G is blocking me. Right now most of the scripts are coded in python, but some essentials are still running on php (though not for long), so i need a running lamp (besides torrentflux and so on…). The last time i set up a clean server on gentoo is quite a few years back now. Eventhough it was a lot of fun and always a good chance to learn some things, I must admit it’s gotten quite easy now. It took me quite some time getting the new php5 running with apache a few years ago. Now theres nothing really special you need to do. Just fire up portage and install it. Before you do, you might wanna edit a few files though. First of all make sure you add mysql and apache2 to your global use flags in /etc/make.conf, then you’ll have to think about some apache options. First of all how will the server process run on your system? Since I’ve loads of RAM and don’t really have any traffic except some requests of my one, no virtual hosts, no nothing, I’ll go with a forked apache. For further information refer to the apache manual. For an forked MPM version of apache just do a quick:
There’s one thing left to do: Define what modules you want your apache to run with. As always gentoo provides a very easy way to do that. If you want to know what modules you can install just do a quick
to see all available modules. You’ll at least want those to be installed, since they are kind of needed 🙂
Not all of them are mandatory, but you’ll at least need to install authz_host, dir and mime for your apache to run. Now you’re ready to go, just fire up portage with a quick
Now just install php by firing up portage again, but remember to set the use flags you’ll need by updating your /etc/portage/package.use, since there are quite some options… As always you can see available use flags by executing an pretended oneshot emerge of php! When you’re done, just install php by
and you’re good to go! Just start your apache with the according init script and everything should work out of the box. You’ll probably want your apache to start automatically too, by adding it to your default runlevel:
But just remember: This is a very basic installation of lamp on your system, it’ll work as it is, but you might wanna tune your settings. As always just refer to the man pages and online documentations!
In order for this to run, you will most likely need a wired network connection, since most wireless-adapters won’t support bridged networking! This description is intended to be used with VirtualBox >= 1.4.0, since earlier versions handle the virtual networking differently due to kernel changes in 2.6.18 and later.
First of all, you’ll have to check the permissions on the device /dev/net/tun . The user running VirtualBox with bridged networking needs to have access to this device. The easiest way to do this is by chown’ing the group vboxusers to it:
sudo chown :vboxusers /dev/net/tun sudo chmod 0660 /dev/net/tun
You will also have to install the package bridge-utils and uml-utilities:
sudo apt-get install bridge-utils uml-utilities
Now we will create 2 scripts which are executed when the virtual machine starts/stops. I will create those scripts in my home dir. Here is the start script, I called it starttun.sh:
#!/bin/bash brctl addbr br0 ifconfig eth0 0.0.0.0 brctl addif br0 eth0 #if you have a dhcp-server uncomment this line: #dhclient3 br0 #If you have a static IP uncomment the following lines and
#change the IP accordingly to your subnet: #ifconfig br0 192.168.178.5 up #route add default gw 192.168.178.1 #Now we will create the tap device for the vm,!
# change your username accordingly tunctl -t tap0 -u simon #Now add the tap-device to the bridge: ifconfig tap0 up brctl addif br0 tap0
Now you’ll have to create the stop script, i called it stoptun.sh 😉
#!/bin/bash #bring the interfaces down ifconfig tap0 down ifconfig br0 down brctl delif br0 tap0 brctl delbr br0 #now setup your network-interface again #for dhcp uncomment the following line #dhclient3 eth0 #For a static IP uncomment the following lines and change them accordingly: #ifconfig eth0 192.168.178.5 #route add default gw 192.168.178.1 dev eth0
Finally you’ll have to make the scripts executable:
sudo chmod ug+x starttun.sh sudo chmod ug+x stoptun.sh
It’s time to set up VirtualBox to use the interface. For this go to the SetUp of your Virtual Machine under Network and tell VirtualBox to start/stop thescripts, when the VM is started/stopped. To do this, select “Host Interface” under Attached To. As Interface Name you use “tap0” and for the startscript you use:
For the stopscript accordingly:
Note: If you use KDE, you’ll have to use kdesu instead of gksudo