Re: Windows Subsystem for Linux && Visual Studio Code

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: PLUG-discuss
Date:  
To: Main PLUG discussion list
Subject: Re: Windows Subsystem for Linux && Visual Studio Code
WOW.... Ok I discovered something or several things I did not know.

Win 10 pro WSL / Ubuntu 16.04LTS LAMP configuration.

Had created several vhosts using the format site.dev.

Local host would work but not site.dev. Drove me crazy... spent a lot
of time trying to figure it out. Scoured the internet looking for what
was wrong. Nothing worked until I happened upon an article that said
.dev is a legitimate TLD owned my Microsoft.

The article suggested using site.localhost and by doing so the Windows
host file does not need to be updated. It worked. I assume this naming
convention will only work on the local machine.

I assume if one wants to reach sites on your local network, one might
use the naming convention site.local - I assume....

I am going to do more testing....

On 2019-12-30 22:41, James Dugger wrote:

> Have you tried going to the site using chrome incognito? This will not use cached settings in chrome. If that works should just be clearing cache.
>
> You can flush windows dns cache settings like this:
> go to command shell in Windows and try
>
> ipconfig /release
> ipconfig /all
> ipconfig /flushdns
> ipconfig /renew
> netsh int ip set dns
> netsh winsock reset
>
> restart Windows
>
> On Mon, Dec 30, 2019 at 5:12 PM Stephen Partington <> wrote:
> Chrome has its own DNS. That is meant to supplement the systems DNS.
>
> On Mon, Dec 30, 2019, 8:05 PM <> wrote:
>
> Ok,
>
> I failed to edit the Windows hosts file. I edited the Linux hosts file. So I finally realized I needed to edit the Windows hosts file.... that is done.
>
> Still unable to pull up the site. Then I recalled the issue I had sometime ago.... Chrome does not like this configuration for some reason.
>
> I am able to view the site in FireFox but not in Chrome.
>
> Not sure why... would like to understand why there is this problem.
>
> Anyone have any thoughts?
>
> I am running Win 10 Pro with the Windows Subsystem for Linux. I'm running Ubuntu 16.04LTS with a LAMP configuration.
>
> I've set the Windows Hosts file to 127.0.0.1 for each of the vhost on the WSL.
>
> I can enter the IP in Chrome and see the site, however when I enter something like MyFramework.dev in the browser URL I get
>
> THIS SITE CAN'T BE REACHED
>
> However I can visit the dev site just fine in FireFox.
>
> Any thoughts?
>
> Thanks!!
>
> On 2019-12-30 16:46, James Dugger wrote:
> What type of site. If WordPress You may need to set AllowOveride directive in the <directory> section
>
> On Mon, Dec 30, 2019, 1:43 PM James Dugger <> wrote:
> What does Apache error_log and access_log say
>
> On Mon, Dec 30, 2019, 1:37 PM <> wrote:
>
> chown -R www-data:www-data did not fix the problem.
>
> On 2019-12-30 15:50, James Dugger wrote:
> Try setting chown -R www-data:www-data on the document root
>
> On Mon, Dec 30, 2019, 12:48 PM Stephen Partington <> wrote:
> This might help.
>
> https://docs.microsoft.com/en-us/windows/wsl/wsl2-install
>
> On Mon, Dec 30, 2019, 3:41 PM <> wrote:
>
> I've been trying to locate a command that will tell me which version of the WSL I am running. The best answer I read was the WSL is tied to the Windows updates.... which I get regularly.
>
> I have a vhost in /etc/apache2/sites-available/myframework.dev.conf with the following excerpt
>
> ...
>
> DocumentRoot /var/www/html/myframework.dev/public_html [1]
> ServerName www.myframework.dev [2]
>
> ...
>
> I enabled myframework.dev.conf and restarted apache...
>
> I edited /etc/hosts and added the following 2 lines :
>
> 127.0.0.1       www.myframework.dev [2] 

>
> 127.0.0.1       myframework.dev [2] 

>
> When I enter the url www.myframework.dev [2] into my browser, I get a message:
>
> THIS SITE CAN'T BE REACHED
>
> I set the file permissions : chmod 755 -R html/ and ownership : chown -R myuser:myuser html
>
> I'm sure it much be something simple....
>
> Note : If I go to localhost in the browser I see a page located at /var/www/html/index.php
>
> Any help is much appreciated.
>
> Keith
>
> On 2019-12-19 02:07, James Dugger wrote:
>
> Are you on the latest version of Windows 10 with WSL2? If not there are huge differences. Prior to WSL2 and the latest Windows 10 developer mode, the WSL sent linux system calls to an emulator that the Windows NT kernel could understand. However with the advent of the latest Windows 10 updates and WSL2 (June 2019) Microsoft installs a full linux kernel with the WSL2 distribution you chose. I think the latest for Ubuntu now is 18.04 on the Microsoft Store. When launched for projects saved and running in the WSL Visual Studio Code now knows the project is a Linux project open with the Linux binaries enabled. You can see this when the bottom left screen lights up in the highlighted text color and indicates WSL.
>
> I have not noticed a lag in VS Code in on either Windows or Linux based projects (lasts versions) . But my system is a core i7. Haven't had to reboot either.
> I am running the latest Windows 10 Version. with Hyper V shut down and VirtualBox installed as a Hypervisor. I don't use the native WSL as a native webserver for PHP applications. I use Vagrant and VirtualBox for building guest machines to run/develop those apps.
>
> Regarding Apache I assume you are setting up separate document root directories for each site declared in different virtual hosts files or section of code in the main apache conf file or separate conf files.
>
> Do you have corresponding settings in the /etc/hosts file that are correctly resolving to your virtual host entries?
>
> On Mon, Dec 16, 2019 at 5:03 PM <> wrote:
>
> Hi,
>
> AZ Pete mentioned the Windows Powershell and the Visual Studio Code editor. I thought I would branch off of that.
>
> I'm not a Python developer. I'm a PHP developer.
>
> In the past I have always used an external LAMP server for development. Currently I have an old i3 laptop that was upgraded to an SSD. Does the job just fine.
>
> A month or so ago I thought I would experiment with the Windows Subsystem for Linux by installing Apache, MySql, and PHP. Worked well, with two exceptions.
>
> I used Visual Studio Code to edit the code "remotely".
>
> I had two issues which I do not recall completely. 1) When I would bring the computer out of screen saver mode it would run really slow and require a reboot. I'm guessing the subsystem went to sleep and was not able to wake up..... 2) As I recall I configured a number of vhosts off of /var/www/html/ which worked well except PHP reported the Docroot was the same as the localhost for all three vhosts, even though they were configured with different Docroots. I wonder if there might be a Apache setting that will correct this?
>
> The subsystem reports its running Ubuntu 16.04.6 LTS.
>
> I think it might be time to dig a little deeper.
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
> --
>
> James
>
> LINKEDIN [3]
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
--

James

LINKEDIN [3]
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss

Links:
------
[1] http://myframework.dev/public_html
[2] http://www.myframework.dev
[3] http://www.linkedin.com/pub/james-h-dugger/15/64b/74a/---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss