Not able to enable Auto create virtual hosts

  • | 953 points

    Laragon gives me error while enabling "auto create virtual hosts".
    This feature i like most about laragon.
    I changed hosts file permissions but it is not working.
    It was working fine with laragon 9.
    I am using windows 10 64 bit

    I am getting this error
    Oops! Your system prevents changing hosts file.
    Please check permissions in security tab or check if the fie is read only.

    Laragon will temporarily disable "Auto crate virtual hosts" feature!

    Si i can not able to enable Auto crate virtual hosts feature.
    Please tell me how to solve this problem.

  • administrators
    | 132054 points

    From version 1.0, Laragon uses nodejs get permissions to modify hosts file, so things may work differerently.

    You hosts file is readonly, so Laragon can not modify.
    You must manually change your hosts file permission.
    Right click your hosts file, then:

    1. Check if your hosts file is not Read-only.
    2. Click Security tab, check if your user has Read & Write permissions checked

  • | 953 points

    I changed permission for users to- Full Control
    But still i cant enable this feature

  • administrators
    | 132054 points

    Could you please show me an image or something?

  • | 953 points

    attached screen shot of hosts permission!


  • administrators
    | 132054 points

    How about Administrators group or Read-only checked or not?

  • | 953 points

    Read only is unchecked .
    Administrator group has all permissions (it is disabled, i can't edit it).

  • administrators
    | 132054 points

    Something like this:

  • | 953 points

    yes same it looks same

  • administrators
    | 132054 points

    @john5db : I've released Laragon 1.0.4. Hope it fixes your issue.

  • | 204 points

    Sometime, the antivirus software is blocking the hosts file access.
    Avira is locking the access, I must change the settings every time I create a new project.

  • | 953 points

    Still not working :disappointed:

  • administrators
    | 132054 points

    Laragon will show instruction message in more details when hosts file is Read-only.
    From the details message you can find out what's wrong.

  • | 953 points

    My current permission screenshot.

  • administrators
    | 132054 points

    Humm. From the information, Laragon should be able to modify your hosts file. @Daniel said sometimes the antivirus is blocking the hosts file access.

    If it is not your case, you can force "Auto create virtual hosts" feature by openC:\laragon\bin\laragon\laragon.ini
    Change AutoVirtualHosts to -1


  • | 273 points

    Hello, i have one tip.

    I create a group (net localgroup GROUPNAME /add), then i add new user to the group (net localgroup GROUPNAME USERNAME /add). Last i add permissions to the files or folders (icacls FILE_OR_PATH /grant GROUPNAME:f /q).

    net user /add DeveloperName *
    net localgroup DevelopersGroup /add
    net localgroup DevelopersGroup DeveloperName /add
    icacls "C:\Windows\System32\drivers\etc\hosts" /grant DevelopersGroup:f /q
    icacls "C:\laragon" /grant DevelopersGroup:f /q

  • | 11 points

    @Daniel thank you,
    this response saved my life

  • | 1094 points

    @lucasprogamer Yes the same case for me with Kaspersky antivirus, after moving laragon services to the trusted zone applications, the problem solved

  • | 953 points

    Thanks You saved my life. Finding solution from 6 months.
    Kaspersky antivirus was restricting it. Its working now.

  • | 152 points

    If you use Webroot Secure Anywhere:

    1. Click Advanced Settings
    2. Click Shields Left Menu
    3. Deselect Prevent any program from modifying the Hosts file:


    Then I changed:

    AutoVirtualHosts=-1 on the laragon\bin\laragon\laragon.ini

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.