Windows Bash Help

Thread Starter

BR-549

Joined Sep 22, 2013
4,928
I have win 10 pro. I went to windows features and turned on linux subsystem and rebooted. Went to win store-----downloaded Ubuntu.

And of course my problems began. It's my UN-ending curse with linux. Where do I begin. With the installation.....of course.

After the install.....it asked for a user name. I gave it one. And for some completely un-understandable explanation, it said name was bad. So I spent about 30 min on google trying to define a proper Ubuntu username.........with no perceivable results.

SO......I highlighted the error in the CLI and tried to copy.....but no copy function.

SO.......I highlighted again and did a ctrl C and the whole CLI disappeared.

When I restarted Ubuntu(under windows).........the CLI came up with a root@mymachinename prompt.

I understand this prompt to be very dangerous. I was going to do some bash tutorials, but do not want to proceed with this prompt.

I have not learned anything yet, but believe I need to create regular user name account and make sure this root does not come up by itself.

Any help would be appreciated.
 

Ya’akov

Joined Jan 27, 2019
9,070
If you want to learn about Linux I would strongly suggest you consider using the free and powerful Virtual Box application to create a virtual machine on your Windows machine and installing a Linux distribution on that. My (limited) experience with the Windows 10 subsystem is not so happy. While it is Linux, it acts strangely because it's not really native. If you learn Linux natively it would make more sense.

The virtual machine is also protection against human error since the worst you can do is mess up the image, which you can have backed up and restore a clean version. There are many ready to go images for Virtual Box, so installation is easy.
 

SLK001

Joined Nov 29, 2011
1,549
The name that you should have given at the prompt was probably "root". If not that, then pour thru the instructions that came with the installation. Linix has to have a username and password to log into the system. Most distributions use "root" as username and "toor" or "password" as the password (but these items will be in the instructions). Quite literally, without the username and password for the distribution, it is useless (you can't log in).
 

MrSoftware

Joined Oct 29, 2013
2,188
You can login as root, use "useradd" command to create a new user. Add that user to the "sudoers" list so it can assume root privileges when necessary. Then set the root user so that it does not have a shell and cannot login directly. Before creating a user, be sure you have chosen a group for them, or know what group you will create for them. Get familiar with /etc/passwd, /etc/shadow and /etc/group. There is plenty of reading on all of this, and I really strongly suggest spending some time on command line basics if you really want to be proficient in Linux.

Of the shells, bash is probably the easiest to use, and is my personal favorite. Not all bash shells are identical, but most commonly to copy you highlight the text with the left mouse button, then click the middle mouse button to copy/paste at once. With a 2-button mouse you can often click both mouse buttons simultaneously to emulate a middle button. Middle click again to paste again. ctl-c will be an interrupt, such as to cancel a running process. ctl-z will pause the foreground process and "bg" will restart execution in the background, "fg" will bring a process back to the foreground. You can also use "&" to initiate a process in the background. "ps" will show you which processes are running. If you need help with a command, at the command prompt type "man [command-name]". For example "man ps". You can also google "man ps". Sometimes you can "ps --help".

You're going to make mistakes learning, and that's OK. The suggestion to use a virtual machine is a very good one while you are learning. VMWare is excellent. With a virtual machine, you can take snapshots in time, and revert to snapshots if necessary. It's like a time machine. For example, assume I want to try a new command to adjust the root user account. So first I take a snapshot. Now I issue my command, and oh crap! I just deleted the root user! No problem, just revert back to the snapshot and presto you're right back to that exact point in time. Virtual machines are excellent tools for learning and can potentially save you hours of time and lots of hair.
 

Thread Starter

BR-549

Joined Sep 22, 2013
4,928
Ok...thanks to all. But like I said it's a curse. I have resolved the windows bash problem.

Linux does not like a capital letter in a username. One would think it was made for me....the grammar and all.

I downloaded virtual box.......and have tried 6 times to install a linux iso........and have failed 6 times.

Can some one take the time to walk me thru this, I have no idea of what I am doing wrong.

The added new procedure.......never has asked me for the iso location.

What gives?
 

SLK001

Joined Nov 29, 2011
1,549
Once VB is running, create a new Virtual Machine. You tell it how large to make it, how much memory to allocate to it, etc. - it's like building a new computer. Once completed, start that VM, then hit F2 (or what ever gives you the boot device choices) and direct it to your Linux distro (fastest way is an .iso file on your HD). Linux should load into the VM. An Linux, like all Unix systems, is very much case sensitive in usernames and passwords.
 

Thread Starter

BR-549

Joined Sep 22, 2013
4,928
When I click on NEW in VB.......I get a series of windows about all that. I fill all that out.

But nothing happens when I start it. And none of those windows ask for a ISO location.
 

SLK001

Joined Nov 29, 2011
1,549
And none of those windows ask for a ISO location.
When you set up your CD Drive, you enter a specific .ISO file location (the distro must be an .ISO file). You can also point it to a USB device with the .ISO installed, or even a real CD Drive with a CD distro on it.
 

Thread Starter

BR-549

Joined Sep 22, 2013
4,928
All-righty, thanks. I have the latest mint-mate running, and a bash terminal.

Much appreciated.
 
Top