Define Network Settings Inside Ubuntu Virtual Machine in VirtualBox

Abstract: Resolve Ubuntu VirtualBox network connectivity issues by configuring adapter types like NAT or Bridged while the VM is powered off.

Created: 2026-09-21 by
To configure network settings inside an Ubuntu virtual machine running in VirtualBox, you must first ensure the virtual machine is powered off to modify hardware-level network adapters. Then, access the VM’s Settings via the VirtualBox Manager, select the Network tab, and choose the appropriate Adapter type such as NAT for internet access or Bridged Adapter for direct LAN connectivity.

Preparing the Virtual Machine

Before making any changes to the network configuration, it is critical that the Ubuntu virtual machine is completely shut down. You cannot modify network adapter settings while the guest operating system is running because these are considered hardware properties managed by the hypervisor. If you attempt to change settings while the VM is active, VirtualBox will either ignore the changes or require a restart of the network service within the guest, which can lead to unstable connections. Navigate to your VirtualBox Manager interface. Locate your Ubuntu instance in the list of virtual machines on the left sidebar. Right-click on the specific VM and select "Settings" from the context menu. Alternatively, you can click the gear icon in the toolbar if the VM is selected. This opens the global settings window for that specific machine. Ensure you do not confuse this with the general VirtualBox application preferences; you need the per-VM settings.

Selecting the Network Adapter Type

The core of configuring network settings lies in selecting the correct adapter mode. In the Settings window, navigate to the "Network" tab. The first tab labeled "Adapter 1" is enabled by default. Here you will find the "Attached to" dropdown menu, which determines how the VM connects to the host network. NAT (Network Address Translation) is the default and most common setting. It allows the VM to access the internet through the host machine’s IP address. The VM appears as a device behind the host router. This is ideal for general browsing, software updates, and downloading packages where you do not need other devices on your local network to see the VM. Bridged Adapter connects the VM directly to your physical network interface. The VM obtains its own IP address from your local router, just like a physical computer plugged into the same switch. This is necessary if you need to SSH into the VM from another computer on your LAN or if you are hosting a web server accessible to other local users. Note that bridging requires the host’s network driver to support promiscuous mode. Internal Network creates a private network between VMs only. No external traffic can pass through this adapter. This is useful for isolated testing environments where security is paramount. NAT Network provides a more advanced version of NAT, allowing multiple VMs to communicate with each other and the host while sharing a single IP for outbound traffic.

Configuring Advanced Network Options

Once the adapter type is selected, you may need to adjust additional parameters. Click the "Advanced" section at the bottom of the Network tab. Here you can set the MAC address. While usually auto-generated, manually setting a static MAC address can prevent conflicts if you clone the VM. If you change the MAC address, be aware that this may disable internet access until the new address is recognized by the DHCP server, a process detailed in our guide on Ubuntu 20.04 on VirtualBox: Missing Internet Access after Changing MAC Address. You can also enable "Cable Connected" to simulate a physical cable plug. If this box is unchecked, the OS will detect no network link. For most configurations, leave this checked. If you are experiencing issues with connectivity, check the "Promiscuous Mode" setting. Set it to "Allow All" if you are using bridged networking and suspect packet filtering issues, though this has security implications.

Verifying Configuration in Ubuntu

After saving the settings in VirtualBox, power on the Ubuntu VM. Once the desktop loads, open a terminal. Use the command ip addr show or ifconfig to view the assigned IP addresses. If you selected NAT, you should see an interface with an IP in the 10.0.2.x range. If you selected Bridged, you should see an IP assigned by your local router, typically starting with 192.168.x.x or 10.0.1.x. Test connectivity by pinging an external site, such as ping 8.8.8.8. If this fails, check your DNS resolution with nslookup google.com. If ping works but domain names fail, your /etc/resolv.conf file may need updating. If you are trying to route traffic between VMs, refer to How to Configure a Traffic Route from VM1 through Host to VM2 for routing table adjustments.

Troubleshooting Common Issues

If the VM shows "Network Cable Unplugged," verify that the "Cable Connected" checkbox is ticked in the VirtualBox settings. Restart the networking service within Ubuntu using sudo systemctl restart networking or reboot the VM entirely. For Bridged Adapter issues, ensure that the host’s Wi-Fi or Ethernet driver supports bridging. Some modern Wi-Fi drivers have limitations with bridging. If you cannot get a bridged connection, try switching to NAT Network or using port forwarding rules in the NAT settings to map host ports to guest ports. If you encounter permission errors during setup, especially when using Vagrant with VirtualBox, check your user permissions. Errors often stem from incorrect group memberships or SELinux policies. See Fixing Permission Denied Error in Vagrant with Ubuntu Jammy64 for solutions to related permission blocks.

Frequently Asked Questions

Why can't I see my Ubuntu VM on the local network?

This usually happens because the adapter is set to NAT instead of Bridged. NAT hides the VM behind the host's IP, making it invisible to other LAN devices. Switching to Bridged Adapter assigns a unique IP to the VM, allowing it to appear as a separate device on your network.

How do I assign a static IP to my Ubuntu VM?

You can configure a static IP by editing the Netplan configuration files in /etc/netplan/. Identify your network interface name using ip link, then create a YAML file specifying the desired IP address, gateway, and DNS servers. Apply the changes with sudo netplan apply.

What is the difference between NAT and NAT Network?

NAT allows individual VMs to access the internet but isolates them from each other unless port forwarding is configured. NAT Network creates a shared subnet where all VMs in the network can communicate directly with each other and the host, while still sharing a single external IP for outbound traffic.

Can I use two network adapters simultaneously?

Yes, VirtualBox allows you to enable up to four network adapters. You can attach one adapter to NAT for internet access and another to Bridged for local LAN communication. Each adapter operates independently and can have different settings.

Why does my VM lose internet access after cloning?

Cloning a VM often generates a new MAC address. If the DHCP server on your network has cached the old MAC address, it may not assign a new IP correctly. Refreshing the network lease by restarting the network manager or renewing the DHCP request usually resolves this issue.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More