VirtualBox Virtual Machine Usage Tips _virtualbox

Source: Internet
Author: User
Tags oracle vm virtualbox vm virtualbox

Recently summed up a number of VirtualBox virtual machine to use the skills to prepare for a rainy days, specific as follows:

1. How to get others to do a good image of the use of their own virtual machine.

Copy the installed virtual system image XXX.VDI files to local. Open the Virtual Box manager.

Select "New"

->next

-> Enter the name of the virtual computer that will be displayed on the left side of the dummy box manager. Choose a good operating system type and version.

-> allocates memory to the virtual computer. The default is 512M, which can be modified to 1024M.

-> the virtual hard disk, choose to use the existing virtual hard disk, open the dialog box, and find the copy to local XXX.VDI file.

Complete.

2. How do I back up a virtual machine?

After installing a system, and enhancements, you can make a clean backup of the system, then if you need a clean system, you can directly use the backup.

Use the "Export virtual computer" feature to back up your system. Select a good image to store the directory, click "Next" to complete.

3. How do I import a backup?

You can add a virtual system in the Virtual Box Manager by using the "Import virtual computer" backup that you exported in the previous step.

Select "Import Virtual Computer", select the directory where the mirror is stored, and next.

-> Note check the bottom option "Reinitialize all network card MAC address (R)" so that the newly generated virtual machine automatically obtains new IP from DHCP and does not conflict with other imported virtual machines. and uncheck the "Network Controller" option for easy startup.

To modify the configuration path for the virtual hard disk: change from C:\user directory to E:\VirtualOS\Server2003_32_Backup_Copy.
Click Import.

-> need to wait a long time to complete. When it is finished, a new system will be generated below, which, if duplicated, will be automatically added to the "_n" to differentiate.

There are 2 questions to note:

(1). If the newly imported MAC address conflicts with the MAC address of the previous system, the system will not be able to access the Internet. You can do the following.

Select the imported virtual machine and right-click the mouse button to select the Settings menu. Select the "Network" option, click on the MAC address line to the right of the refresh chart, get a new MAC address, click OK.

(2). If you do not change the configuration path for the virtual hard disk: change from C:\user directory to E:\VirtualOS\Server2003_32_Backup_Copy. The "harddisk" file for the newly imported system is generated in the same folder as the "C:\Users\jlzhang\VirtualBox vms\server2003_32_1" config file. It is a "vmdk" file. The file is too big to occupy the C disk space.

4. How to assign a separate IP to the virtual machine?

Sometimes the virtual machine system requires a separate IP to communicate with the external host, when the virtual machine needs to obtain a separate IP.

Use bridging mode to connect to the external network. Right-click on the system shown in the left column of virtual Box Manager

-> Select "Settings"

-> Click the "Network" option

-> on the Network card 1 option page, connect by selecting "Bridging Network card."

Confirm.

5. The difference between "normal shutdown" and "exit" in the Control menu

"Exit" means to force an exit. Under normal circumstances, the virtual machine shut down normally. If you always force the exit, an error occurs on the virtual hard disk, causing the file to become corrupted.

6. Install the enhancement function

The role of VirtualBox Guset additions consists of the following points:

To achieve smooth mouse movement between client and host

Implementing file sharing with the host

Share the contents of the Clipboard with the host, which means that it can be copied, pasted between the host and the client directly

Use the sound system, or you can't listen to music with a virtual machine.

Synchronization with host implementation time

Automatically log on to Windows

The specific action is to start the client system and select Install enhancements (Install guset additions) in drives. In the pop-up dialog box, basically "next" is OK. After the installation is complete and you need to reboot the client system, you can see a quad-shaped icon in the lower-right corner, indicating that the system is running Oracle VM VirtualBox Guest additions. At this point, the mouse can move at random before the current system and client system, and before installing VirtualBox guset Additions, it is necessary to press the combination key "Ctrl+alt+delete" to return to the current system from the client system. And the system automatically adjusts the pixel according to the size of the current VBox window, and it can be displayed in full screen.

The drawback of this feature is that after the guest additions is installed, the client is basically bound to a specific vbox environment, which is detrimental to the cloning and migration of virtual machines.

7. VirtualBox Network Configuration

In VBox, you can add four network cards to the same virtual machine, and set different modes for different network adapters. For example, add two network card piece of connection is NAT, the other is Host-only Adapter, so that the client can both secure the Internet, can also communicate with the host.
NAT Mode

VBox default is NAT (Network address translation), the Guest OS (client system) installed (Networking mode is set to DHCP), you can directly connect to the network. Using NAT, the Client access network is provided by the host (in fact, the NAT server through the host, which is VirtualBox built). In this way, the client's network address extranet is not visible, so the extranet can not access the client, and the host can not access the client through the network, to the host to upload some data to the client, is not to do.

When testing, host IP is 10.8.5.24 intranet address, the host view VBox IP, the results are as follows:
From the client's internal view, the client's own IP address is 10.0.2.15 intranet address, the gateway is 10.0.2.2, using the route command, see the results are as follows:
The host can ping 169.254.134.226 (client IP viewed from the host) but cannot ping the client 10.0.2.15 (the IP address of the client itself viewed from within the client) The client ping is 169.254.134.226, but the client can ping the host (host IP is 10.8.5.24) and can access the Internet normally.

Bridging mode (bridged Adapter)

Change the client's network connection to bridging, and then to the virtual system, set the IP to the same network segment as the host IP. At this point, the client is equivalent to a stand-alone host on the network. Hosts, virtual machines, and other workstations on the network can access each other directly. If only the client is allowed to communicate with the host, only the host network card must be set up with a dual IP, one for the internet, one for communicating with the virtual machine, without having to modify the client's network connection mode. This is the same as having two hosts set to the same network segment, and then connecting with a single wire, you can communicate.

Intranet Mode (Internal)

As the name implies is the internal network mode, the virtual machine and the external network completely disconnected, only the virtual machine in the virtual machine between the internal network mode. On the host at the same time open two clients, IP set to 192.168.1.1 and 192.168.1.2 (Masks are 255.255.255.0, the gateway is not set), you can communicate normally.

Host mode (Host-only Adapter)
This mode, it is said that VBox in the host to simulate a dedicated virtual machine to use the network card, all virtual machines are connected to the network card (host VirtualBox host-only Network network card), you can use this network card to achieve the Internet and other functions.

If you want the VBox virtual machine to have access to the extranet, set the local connection for the host system to be shared with VirtualBox host-only network. The IP address of the VirtualBox host-only network is set automatically, as shown in the figure, with IP 192.168.137.1 at the time of the test and 255.255.255.0 for the subnet mask.
The IP is set to the address of the same network segment in the client computer and the DNS address is set to the DNS address used by the host. Theoretically, the client and the host, the other workstations on the network can be connected, but in the actual test, (reactivated network card, restart the client), the client can only communicate with the host, and only in the 192.168.137.0 this network segment to communicate.

8. How do I implement a VirtualBox virtual machine shared with a Windows host?

Reference: http://www.jb51.net/article/97271.htm

9. How to set up between the virtual machine and the host can copy and paste each other?

When you select a virtual mirror in VirtualBox, click the "Settings" button, under Generla->advanced, the Shared clipboard default is disabled, and it can be modified to bidirectional.

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.