Posts tagged network

Grep Without a Pipe

Grep is used commonly to filter the printout of ls and ps commands. It will only print the search criteria that is the parameter of the grep command. For example:

ps aux | grep apache2

The previous command will determine if apache2 has a running process. You can also use the grep command without the pipe. This will search a folder, which you can do recursively with -r, and look for a particular string in the files. You can sift through the contents of the entire /etc directory for a particular string. How powerful!

sudo grep -r static /etc/*

The above command will most likely pull up /etc/network/interfaces, particularly if your network adapter is setup as static.

VirtualBox Bridge and Tap no Longer Needed – Built in

With recent version of VirtualBox you no longer need to create a bridge and tap to enable host networking. In the settings panel of the virtual machine, select the network tab, and make sure that its set on bridged adapter. VirtualBox automatically creates a virtual ethernet adapter, and bridges it to the network of the host machine.

Bridging to the host network is necessary for the virtual machine to get an ip address from the router. Such a configuration is needed to communicate with the machine from the outside world. Because of this feature virtual machines can server website, and other services. I use my virtual machine to host this website, a visual ftp server, a wiki, and an EyesOS server.

There are other ways to forward individual ports from the host system to the guest, but then the ports on the host machine will not be accessible on the host; they will virtually represent the guest OS thus hindering connectivity with the host machine. There may be instances where this is what is wanted and more information, including instruction, can be found on this previous post.

The following is a screenshot of the network tab in VirtualBox. It had a bridge adapter option that will autobridge the connection to an existing ethernet adapter. Bare in mind that this is the screen from a Linux install of VirtualBox and it might be different in Windows. I remember in Windows you might have the option to create a virtual ethernet adapter, and then you can bridge the connection all in VirtualBox. Nothing needs to be done manually anymore, and everything can be done from within the VirtualBox configuration panels.

Screenshot-Windows XP - Settings

Here is a screen from Windows Vista. Go to the network tab of the virtual machine settings:

Network settings

Then select the attach to drop down menu:

Attach

Then change the attach to, drop down menu, to bridged adapter:

Bridged adapter

PXE Network Boot VirtualBox

You need host networking enabled to boot via the network. Check here for prerequisite configuration.

VirtualBox is capable of network boot, and is practically indistinguishable in configuration as compared to a real machine. To PXE boot a VirtualBox guest OS open the settings of a guest OS:

VirtualBox Settings

Click the system tab:

System tab

To enable PXE boot you have to configure the following section:

Boot section.

Then use the up and down arrows to set the priority of the network boot feature, as shown above.

Up and Down Arrows

You can create a guest OS that has no hard drive; there is no need for one. In such a configuration make network boot the first on the list. :)

Since you intend to use PXE boot, you may consider setting up a LTSP server.

VirtualBox Windows Vista – Host Network Bridge and Tap

This entire post is no longer applicable to the most recent version of VirtualBox. Here is a more recent post.

VirtualBox is well equipped for a Windows environment. Most of its features have a mechanism for automatic installation and setup. To get your guest OS, in Windows Vista, to have a real IP address from your router you first need a network bridge and tap. Open the VirtualBox manager:

VirtualBox manager screenshot

Then select a guest OS and open its settings. Then click the network tab:
VirtualBox manager network tab

Then click the add network tap button:
Add network tap button

It doesn’t matter what the name is :) Then adjust your guest OS networking adapter accordingly.

Enable host network

Now open your Windows Vista network configurations manager:

Microsoft Vista network configuration

This screenshot is what your network configurations should be after everything is done. To achieve this simply select both the VirtualBox tap, that was previously created, and bridge it to your LAN connection. Select both by click on each adapter while pressing the shift key. Then right click on either of the two highlighted icons and select “bridge”. This will automatically create a bridge between the tap and your real host networking adapter. Wham bam, now you can select a real static IP in your VirtualBox guest OS on a Windows Vista system :)

Update (12/4/2009); At the top of this post I say that the information here is outdated. You can view the post listed above if you want, but here are the pertinent screenshots also:

Here is a screen from Windows Vista. Go to the network tab of the virtual machine settings:

Network settings

Then select the attach to drop down menu:

Attach

Then change the attach to, drop down menu, to bridged adapter:

Bridged adapter