Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Windows 10 Home #94

grtwje started this conversation in General
Discussion options

I'm running Windows 10 Home, and I did not want to bother with setting up a Linux VM. Here are some of the things I had to do to get the tutorial running (at least through tutorial 5). These tips are not meant as a definitive guide, but just to give an idea of what is involved.

I'm running Windows 10 Home 20H2. I already had a Rust development environment for a Windows target (Rust 1.48, Visual Studio Code 1.51.2 + Rust extensions, Visual Studio Community 2019).

  1. Enable Windows Services for Linux (WSL). I used this guide.
  2. Install a WSL Linux distribution from the Microsoft Store. I picked Ubuntu.
  3. It's in the install guide, but make sure your Linux distribution is running WSL 2 (not 1). This took me a while to figure out because the wsl command kept telling me I had no Linux installed. Eventually wsl found my Linux, and I set it to be WSL 2. I have BOINC running in the background that might have slowed things down for me.
  4. Install Docker Desktop for Windows, link. Note that if your Windows account is not an administrator account, the account will not be added to the docker-users group. In a Windows admin shell use net localgroup docker-users "your-user-id" /ADD to add the account to the group.
  5. Add the "Remote - WSL' extension to VS Code.
  6. From the File menu of VS Code select 'Open Folder in WSL...' and selct the 01_wait_forever folder.
  7. From the Terminal menu select New Terminal to get a Linux shell.
  8. From here I just kept typing make and adding missing packages until the make succeeded.
  • apt install make
  • curl https://sh.rustup.fs -sSf | sh
  • apt install build-essential
  • cargo install cargo-binutils
  • cargo install rustfilt
You must be logged in to vote

Replies: 1 comment

Comment options

Just a quick followup, not really related to the tutorial...

If after doing the above to get WSL set up for Rust and you want to cross compile for Raspian, only a little more is required.

  • In the Ubuntu WSL I ran sudo apt-get install gcc-multilib-arm-linux-gnueabihf
  • Also in the Ubuntu WSL, I added the following lines to ~/.cargo/config:
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

Then using a 'Hello, world!" example, in Ubuntu WSL:

  • Create the hello project: cargo new hello-rpi --bin
  • Build the hello project: cargo build --target=armv7-unknown-linux-gnueabihf
  • Copy the hello binary to the Raspberry Pi: scp target/armv7-unknown-linux-gnueabihf/debug/hello-rpi raspberrypi:hello-rpi

Then on the Raspberry Pi target,

$ ./hello-rpi
Hello, world!
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /