
我正在嘗試調試一個問題,並試圖找出我的特定機器是否有 IP。如何顯示 Virtualbox DHCP 伺服器的所有租約?我無法登入來賓的原因是,它是一個 Vulnhub 虛擬機器。找出登入機器的方法是練習的重點。
答案1
在 Linux 上:
cat $HOME/Library/VirtualBox/NatNetwork-Dhcpd.leases
在 Windows 上:
%userprofile%\\.VirtualBox\HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter-Dhcpd.leases
這是文件:
<?xml version="1.0"?>
<Leases version="1.0">
...
<Lease mac="08:00:27:45:fb:92" network="0.0.0.0" state="acked">
<Address value="10.0.2.15"/>
<Time issued="1594735097" expiration="600"/>
</Lease>
...
</Leases>
你可以從 vm 中找到 macvboxmanage showvminfo smp318 | grep MAC
您可以列出正在執行的虛擬機vboxmanage list runningvms
答案2
在 Debian 系統上:
cat ~/.config/VirtualBox/(your network name).leases
您可以
ls ~/.config/VirtualBox | grep ".leases"
查看創建的所有網路的所有 DHCP 租約。