Using dcload-ip with Windows Subsystem for Linux: Difference between revisions

From dreamcast.wiki
Jump to navigation Jump to search
(Created page with "{{MARKDOWN}} # WSL v2 : using dcload-ip with the BBA from WSL and Windows This tutorial has been tested on Windows 10 Insider Preview and Windows Subsystem for Linux (WSL) v2....")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{MARKDOWN}}
=WSL v2: using dcload-ip with the BBA from WSL and Windows=
# WSL v2 : using dcload-ip with the BBA from WSL and Windows
This tutorial has been tested on Windows 10 and Windows Subsystem for Linux (WSL) v2.
This tutorial has been tested on Windows 10 Insider Preview and Windows Subsystem for Linux (WSL) v2.
My Dreamcast is connected directly to a router that is also connected to my computer, the router is not plugged into anything else, and does not having greater network access, and using dcload-ip with a hardcoded static IP address.
My Dreamcast is connected directly to a router that is also connected to my computer, the router is not plugged into anything else, and does not having greater network access, and using dcload-ip with a hardcoded static IP address.


## Dreamcast side
==Dreamcast side==
Get a selfbooting version of [dc-load-ip (in the "Releases" section)](https://github.com/Moopthehedgehog/dcload-ip). I've burned this with [imgburn](https://www.instructables.com/id/Dreamcast-Burn-Games-with-ImgBurn/) without any problem.
[[:File:Dcload-2022-12-17.zip|Get a selfbooting version of dcload-ip]]. I've burned this with [https://www.instructables.com/id/Dreamcast-Burn-Games-with-ImgBurn/ imgburn] without any problem.


Next, boot **dc-load-ip** in your Dreamcast and make sure your BBA is connected in order to get your BBA mac address.
Next, boot '''dc-load-ip''' in your Dreamcast and make sure your BBA is connected in order to get your BBA MAC address.


Once the green/blue screen appears (depending on version, moop: green, standard: blue), note down your MAC address. It should look something like :  `10:04:5d:2b:0f:4d`
Once the green screen appears, note down your MAC address. It should look something like:  <code>10:04:5d:2b:0f:4d</code>


## Computer side (not necessary if using pre-built DHCP version)
==Computer side (not necessary if using pre-built DHCP version)==
We'll use the arp function to get your computer to "give" an IP address to your Dreamcast based on its mac address.  
We'll use the arp function to get your computer to "give" an IP address to your Dreamcast based on its MAC address.  


### Under a Windows Terminal
===Under a Windows Terminal===
First we need Administrator access to add an arp entry.
<syntaxhighlight lang="powershell">Start-Process PowerShell –Verb RunAs</syntaxhighlight>


First we need Administrator access to add an arp entry
After you have this PowerShell instance open we will add our entry:


``Start-Process PowerShell –Verb RunAs``
<syntaxhighlight lang="powershell">New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "[IP address]" -LinkLayerAddress "[MAC address]"</syntaxhighlight>


After you have this PowerShell instance open we will add our entry
*If using Wifi, the interface alias is likely <code>"Wi-Fi"</code>


``New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "[local IP address]" -LinkLayerAddress "[MAC address]"``
This is the command I use:


- If using Wifi, the interface alias is likely ``"Wi-Fi"``
<syntaxhighlight lang="powershell">New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"</syntaxhighlight>
 
This is the command I use
 
``New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"``


This should be fairly straightword to modify for your needs and network setup. This will be a permanent addition which will persist across restarts and shutdowns.  
This should be fairly straightword to modify for your needs and network setup. This will be a permanent addition which will persist across restarts and shutdowns.  


Expected Output:
Expected Output:
```
<pre>PS C:\WINDOWS\system32> New-NetNeighbor -InterfaceAlias "Ethernet"  -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"
PS C:\WINDOWS\system32> New-NetNeighbor -InterfaceAlias "Ethernet"  -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"


ifIndex IPAddress        LinkLayerAddress      State      PolicyStore
ifIndex IPAddress        LinkLayerAddress      State      PolicyStore
------- ---------        ----------------      -----      -----------
------- ---------        ----------------      -----      -----------
18      192.168.2.200    00-D0-F1-02-5E-8F    Permanent  ActiveStore
18      192.168.2.200    00-D0-F1-02-5E-8F    Permanent  ActiveStore
18      192.168.2.200    00-D0-F1-02-5E-8F    Permanent  PersistentStore
18      192.168.2.200    00-D0-F1-02-5E-8F    Permanent  PersistentStore</pre>
```
 
## Notes
 
`[local IP address]` is any valid IP address that you want to assign to your Dreamcast
 
`[MAC address]` is your dreamcast's MAC address, look at step 2.
 
the local IP address should be in the same range as your network. In my setup, my ethernet port is set on port 192.168.5.100 and my `[local IP address]` is 192.168.5.99. If you don't know your network range, you can use `ifconfig` in a terminal to find out. I wont cover this here.


## The following can be executed from within Windows or WSL (Linux)
==Notes==
*<code>[IP address]</code> is any valid IP address that you want to assign to your Dreamcast.
*<code>[MAC address]</code> is your Dreamcast's MAC address, look at step 2.
The IP address should be in the same range as your local network. In my setup, my ethernet port is set on port 192.168.5.100 and my <code>[IP address]</code> is 192.168.5.99. If you don't know your network range, you can use <code>ifconfig</code> in a terminal to find out. I won't cover this here.


==The following can be executed from within Windows or WSL (Linux)==
At this point, you should be able to see if your Dreamcast is connected.
At this point, you should be able to see if your Dreamcast is connected.


A simple ping command should do the job.
A simple ping command should do the job.
<syntaxhighlight lang="bash">ping [IP address]</syntaxhighlight>


`ping [local IP address]`
You should get a message like: ''64 byte from [IP address] .... blabla ... time=xx ms''


you should get a message like : 64 byte from [local IP address] .... blabla ... time=xx ms
===Testing your code===
You can now use the dc-tool-ip program to send your file to the DC. Make sure your Dreamcast is running '''dc-load-ip'''.


### Testing your code
<syntaxhighlight lang="bash">dc-tool-ip -t [IP address] -x /path/to/your/.bin/or/.elf/file</syntaxhighlight>
You can now use the dc-tool-ip program to send your file to the DC. Make sure your Dreamcast is running **dc-load-ip**.
 
`dc-tool-ip -t [local IP address] -x /path/to/your/.bin/or/.elf/file`


You can always run dc-tool-ip without any command to get some info on how to run it.
You can always run dc-tool-ip without any command to get some info on how to run it.
The -c option is useful if you need to use files that are located on your pc. You can use them with the `/pc` path.
The -c option is useful if you need to use files that are located on your pc. You can use them with the '/pc' path.
 
## Notes (for non-DHCP use)
### Adding a host name (Linux)
Also, you can add a line to your host file in order to replace [local IP address] to a more friendly name.
 
`sudo nano /etc/hosts`
then adding the line :
`dreamcast [local IP address]`
 
### Adding a host name (Windows)
1. Press the Windows key.
1. Type Notepad in the search field.
1. In the search results, right-click Notepad and select Run as administrator.
1. From Notepad, open the following file:


``c:\Windows\System32\Drivers\etc\hosts``
==Notes (for non-DHCP use)==
===Adding a host name (Linux)===
Also, you can add a line to your host file in order to replace [IP address] to a more friendly name.
<syntaxhighlight lang="bash">sudo nano /etc/hosts</syntaxhighlight>
then adding the line:


1. Add a new entry to the file.
<code>dreamcast [IP address]</code>
2. eg. `dreamcast [local IP address]` on a newline
3. Select File > Save to save your changes.


You can now refer do `dreamcast` instead of your usual `[local IP adress]`
===Adding a host name (Windows)===
# Press the Windows key.
# Type Notepad in the search field.
# In the search results, right-click Notepad and select Run as administrator.
# From Notepad, open the following file: <code>c:\Windows\System32\Drivers\etc\hosts</code>
# Add a new entry to the file. e.g. <code>dreamcast [IP address]</code> on a newline
# Select File > Save to save your changes.


_Other info at [CubicVR](https://github.com/cjcliffe/CubicVR/wiki/Dreamcast:-dc-load-ip)_
You can now refer to <code>dreamcast</code> instead of your usual <code>[IP address]</code>

Latest revision as of 18:32, 6 January 2023

WSL v2: using dcload-ip with the BBA from WSL and Windows

This tutorial has been tested on Windows 10 and Windows Subsystem for Linux (WSL) v2. My Dreamcast is connected directly to a router that is also connected to my computer, the router is not plugged into anything else, and does not having greater network access, and using dcload-ip with a hardcoded static IP address.

Dreamcast side

Get a selfbooting version of dcload-ip. I've burned this with imgburn without any problem.

Next, boot dc-load-ip in your Dreamcast and make sure your BBA is connected in order to get your BBA MAC address.

Once the green screen appears, note down your MAC address. It should look something like: 10:04:5d:2b:0f:4d

Computer side (not necessary if using pre-built DHCP version)

We'll use the arp function to get your computer to "give" an IP address to your Dreamcast based on its MAC address.

Under a Windows Terminal

First we need Administrator access to add an arp entry.

Start-Process PowerShell Verb RunAs

After you have this PowerShell instance open we will add our entry:

New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "[IP address]" -LinkLayerAddress "[MAC address]"
  • If using Wifi, the interface alias is likely "Wi-Fi"

This is the command I use:

New-NetNeighbor -InterfaceAlias "Ethernet" -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"

This should be fairly straightword to modify for your needs and network setup. This will be a permanent addition which will persist across restarts and shutdowns.

Expected Output:

PS C:\WINDOWS\system32> New-NetNeighbor -InterfaceAlias "Ethernet"  -IPAddress "192.168.2.200" -LinkLayerAddress "00-D0-F1-02-5E-8F"

ifIndex IPAddress         LinkLayerAddress      State       PolicyStore
------- ---------         ----------------      -----       -----------
18      192.168.2.200     00-D0-F1-02-5E-8F     Permanent   ActiveStore
18      192.168.2.200     00-D0-F1-02-5E-8F     Permanent   PersistentStore

Notes

  • [IP address] is any valid IP address that you want to assign to your Dreamcast.
  • [MAC address] is your Dreamcast's MAC address, look at step 2.

The IP address should be in the same range as your local network. In my setup, my ethernet port is set on port 192.168.5.100 and my [IP address] is 192.168.5.99. If you don't know your network range, you can use ifconfig in a terminal to find out. I won't cover this here.

The following can be executed from within Windows or WSL (Linux)

At this point, you should be able to see if your Dreamcast is connected.

A simple ping command should do the job.

ping [IP address]

You should get a message like: 64 byte from [IP address] .... blabla ... time=xx ms

Testing your code

You can now use the dc-tool-ip program to send your file to the DC. Make sure your Dreamcast is running dc-load-ip.

dc-tool-ip -t [IP address] -x /path/to/your/.bin/or/.elf/file

You can always run dc-tool-ip without any command to get some info on how to run it. The -c option is useful if you need to use files that are located on your pc. You can use them with the '/pc' path.

Notes (for non-DHCP use)

Adding a host name (Linux)

Also, you can add a line to your host file in order to replace [IP address] to a more friendly name.

sudo nano /etc/hosts

then adding the line:

dreamcast [IP address]

Adding a host name (Windows)

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
  5. Add a new entry to the file. e.g. dreamcast [IP address] on a newline
  6. Select File > Save to save your changes.

You can now refer to dreamcast instead of your usual [IP address]