Cannot Ping Kali Ubuntu from Ubuntu: A VirtualBox Firewall Issue

Abstract: Resolve ping failures from Ubuntu host to Kali Linux guest by allowing ICMP traffic through the UFW firewall.

Created: 2026-09-05 by
You cannot ping your Kali Linux virtual machine from the host Ubuntu system because the default firewall configuration in Kali blocks ICMP echo requests. This security measure prevents external hosts from discovering the VM, which breaks basic network diagnostics like ping. To restore connectivity, you must adjust the Uncomplicated Firewall settings on the guest OS to allow incoming ICMP traffic while maintaining overall security for other services.

Understanding the Root Cause

When you install Kali Linux as a VirtualBox guest, the operating system comes with strict security defaults out of the box. One of these defaults is the ufw (Uncomplicated Firewall) service, which is often enabled immediately upon first boot or during installation if you selected a secure profile. By default, ufw denies all incoming connections unless explicitly allowed. While this is excellent for protecting against remote attacks, it inadvertently blocks the Internet Control Message Protocol (ICMP) packets used by the ping command.

The host Ubuntu system sends an ICMP Echo Request to the IP address assigned to the Kali VM. Because the firewall on the Kali side drops this packet without responding, the host receives no reply and reports "Request timed out" or "Destination Host Unreachable." This behavior is not a VirtualBox networking error but rather a deliberate security feature of the Kali Linux distribution. Understanding this distinction is crucial before attempting complex network troubleshooting.

Verifying Network Connectivity and Firewall Status

Before modifying firewall rules, it is important to confirm that the issue is indeed caused by the firewall and not by incorrect VirtualBox network adapter settings. First, ensure that the VirtualBox network adapter for the Kali VM is set to either NAT, Bridged Adapter, or Host-Only mode, depending on your desired communication pattern. For simple host-to-guest pinging, Bridged or Host-Only modes are typically the most straightforward.

Once the network interface is configured, log into the Kali Linux terminal. You can verify the current status of the firewall by running the following command:

sudo ufw status verbose

If the output shows "Status: active," then the firewall is enforcing rules. If you see no specific rule allowing ICMP, the drop policy is likely in effect. You should also check the IP address of the Kali VM using ip addr show to ensure it has a valid IP on the same subnet as your host Ubuntu machine. If the IPs are on different subnets, you may need to adjust VirtualBox router settings or switch to a Bridged connection.

Configuring UFW to Allow ICMP Traffic

To resolve the ping issue, you need to create an exception for ICMP traffic in the ufw configuration. This allows the host to send echo requests and receive echo replies without exposing other vulnerable ports. Open a terminal in the Kali Linux guest and execute the following command to allow ICMP:

sudo ufw allow icmp

This command adds a rule to the firewall that permits all ICMP traffic. It is generally safe to allow ICMP for internal virtual networks because it does not expose application-layer vulnerabilities. After adding the rule, you should reload the firewall to ensure the changes take effect immediately:

sudo ufw reload

Verify that the new rule is active by checking the status again with sudo ufw status. You should see a line indicating "Anywhere ALLOW ICMP." Now, return to your host Ubuntu system and attempt to ping the Kali VM's IP address again. The request should now be answered successfully.

Alternative Solutions and Security Considerations

If you prefer not to modify the firewall rules permanently, there are alternative approaches. You could temporarily disable the firewall entirely by running sudo ufw disable, but this is strongly discouraged for any system connected to a network, even a virtual one, as it leaves the VM exposed to all inbound traffic. Another option is to use iptables directly to add a more granular rule, but ufw is the preferred management tool for Ubuntu-based systems.

It is also worth noting that some advanced users might configure their VirtualBox NAT engine to forward specific ports, but this does not help with ICMP ping. If you are experiencing broader connectivity issues beyond just ping, such as SSH failures or web server access problems, you may need to look at related configurations. For instance, if you find that SSH works but other connections fail, you might want to investigate how UFW blocks connection to another server to understand deeper firewall interactions. Similarly, if you are setting up this VM for development purposes, ensuring proper security hardening is essential, so reviewing guides on securing an Ubuntu server for development can provide additional context on best practices.

Remember that allowing ICMP is primarily for diagnostic purposes. In production environments, it is often recommended to block ICMP entirely to prevent network reconnaissance. However, for local virtualization labs and testing environments, enabling it simplifies troubleshooting significantly. Always ensure that your VirtualBox host-only or bridged networks are isolated from public internet interfaces to maintain a secure perimeter.

Frequently Asked Questions

Why can I ping other machines but not my Kali VM?

This usually indicates that the target machine has a stricter firewall configuration than others on your network. Kali Linux enables ufw by default with a deny-all incoming policy, whereas many standard Ubuntu desktop installations leave the firewall disabled or less restrictive. You must explicitly allow ICMP on the Kali guest to match the behavior of other responsive machines.

Does allowing ICMP compromise the security of my Kali VM?

Allowing ICMP is considered low-risk for internal virtual networks. It only permits echo requests and replies, which do not expose application data or open ports. However, it does reveal the existence of the VM to anyone who can reach its IP address, so avoid enabling this on networks exposed to untrusted external hosts.

How do I revert the change if I made a mistake?

You can remove the ICMP rule by running sudo ufw delete allow icmp in the Kali terminal. After deletion, run sudo ufw reload to apply the change. Your VM will stop responding to ping requests again, returning to its default secure state.

Can I use iptables instead of ufw for this task?

Yes, you can use iptables directly, but it is more complex and prone to syntax errors. Using ufw is the recommended approach for Ubuntu-based systems because it provides a simpler interface for managing firewall rules. Converting between the two tools can sometimes lead to conflicts, so stick to ufw for consistency.

What if my VM still doesn't respond after adding the rule?

If the firewall is correctly configured but ping still fails, check your VirtualBox network adapter settings. Ensure the VM is using a Bridged or Host-Only adapter rather than NAT, as NAT restricts inbound traffic from the host. Also, verify that the host and guest are on the same logical network segment by comparing their IP addresses.

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