Update windows host file when mac IP changes

Discussion in 'Windows Virtual Machine' started by IainM2, Sep 16, 2023.

  1. IainM2

    IainM2 Bit poster

    I have a MacBook Pro with Apple silicon and am using my Windows 11 parallels VM for development. I required an SQL server to be set up and followed this excellent article: https://www.parallels.com/blogs/microsoft-sql-apple-silicon-docker-desktop/ by Carlos Lapao. It works brilliantly. However, it relies on the MacBook IP address being known. I move around quite a lot, so the IP address changes regularly. I was trying to automate the host file update on the Windows machine but could not find any way to access the MacBook IP from the windows machine.
    Things I tried:
    • Using Arp-a and filtering on the MacBook's Mac address - Only available if I have already pinged the IP address so not useful
    • prlctl exec to write the IP address to a file to be read by a scheduled task on the windows VM - this would not write to a file on the machine although it seemed to execute ok
    • Share a file ip.txt that is updated periodically on the mac and read on the windows VM - I cannot find any way to get access to the shared drives via powershell. They work if I run them manually but as soon as I run them as a scheduled task they cannot access the shared drives
    Any ideas would be appreciated

Share This Page