ZBLOG

i installed ubuntu server 2204 on vmware pro workstation, the ip of the virtual machine is changing from time to time, how to fix the ip addr of the virtual ubuntu server running on vmware?

To assign a fixed IP address to your Ubuntu Server running on VMware Workstation, you need to configure a static IP address in the Ubuntu network settings. Here’s how you can do it:

  1. Start the Ubuntu Server virtual machine in VMware Workstation.
  2. Log in to the Ubuntu Server using your credentials.
  3. Open a terminal window.

Next, we’ll configure the network settings manually by modifying the netplan configuration file.

  1. Run the following command to edit the netplan configuration file:

    sudo nano /etc/netplan/00-installer-config.yaml
    
  2. In the editor, you will see some YAML code. Look for the network interface section and modify it as follows:

   network:
     ethernets:
       enp0s3:  # Replace with your actual network interface name (use ifconfig or ip addr show command to find it)
         dhcp4: no
         addresses: [192.168.1.100/24]  # Replace with the desired static IP address and subnet mask
         gateway4: 192.168.1.1  # Replace with your router's IP address
         nameservers:
           addresses: [8.8.8.8, 8.8.4.4]  # Replace with preferred DNS server addresses
     version: 2
  1. Once you’ve made the changes, press Ctrl + X to save and exit the editor.

  2. Apply the new network configuration by running this command:

    sudo netplan apply
    

The static IP address should now be configured on your Ubuntu Server virtual machine running on VMware Workstation.

Please note that these instructions assume you are using a single virtual NIC (network interface card) for your VM and that it is connected to a NAT or bridged network within VMware Workstation. If you have multiple network interfaces or a different network configuration, you may need to adjust the instructions accordingly.

Also, make sure that the chosen static IP address is not already assigned to another device on your network to avoid conflicts.

If you encounter any issues or need further assistance, feel free to ask!


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://sdn.0voice.com/?id=3074

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?