VirtualBox Win98SE install shared folder on Samba (!,?,Bug)

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
-CO-Windler
Level 1
Level 1
Posts: 29
Joined: Mon Mar 22, 2021 12:44 am
Location: Germany
Contact:

VirtualBox Win98SE install shared folder on Samba (!,?,Bug)

Post by -CO-Windler »

After long experiments I got shared folders partially to work on Win98SE in VirtualBox without Guest Additions. There is no good tutorial yet and I found more questions than answers and a workaround for a strange bug.

This is not a FAQ but may help to setup DOS based Windows on modern machines, because without shared folders it is almost impossible to easily export large files from the virtual partition back to the host filesystem and so create works (unlike playing games) with historical software. While it is easy to get Windows 95/98 halfway installed in a VM on modern PCs, from what I read on the internet, most people seem to give up when they run into setup trouble.


With modern CPUs (like my AMD Ryzen 2400G) you will need to disable 32bit protected mode filesystem access in system controls of Win98SE (boot in safe mode if it won't start), else the filesystem driver will fail by page cache bugs, causing random unreadable files (often complaining DLLs with non-existing filenames). The nasty thing is that safe mode can not be reached in VirtualBox because holding Ctrl or F5 or F8 during boot did nothing. I only could fix this by first installing a DOS boot menu in AUTOEXEC.BAT by booting into the DOS mode of the Win98SE setup CD to see the option to press F5 for safe mode. (Possibly the Win98SE setup CD simply needs to be removed first to get there without menu.) Here I found Ryzen Win98SE VM problems documented.

Windows 98 SE VM on a Ryzen 3000 not working
https://www.vogons.org/viewtopic.php?f= ... 5&start=20

Windows 9x TLB Invalidation Bug
https://blog.stuffedcow.net/2015/08/win ... ation-bug/

In VirtualBox my Win98SE failed with protection fault when installing SciTech DisplayDoctor 7 (the best graphics driver). Apparently my Ryzen 5 CPU AMD 2400G is too new. The correct fake CPU setting is "Intel Pentium 4 3.00GHz". Also select VBoxSVGA with 3D acceleration (reclick if it returns to VBoxVGA).

In Linux you have to enter this into a terminal:

Code: Select all

VBoxManage modifyvm "Windows 98SE" --cpu-profile "Intel Pentium 4 3.00GHz"

(Note: Here "Windows 98SE" is the name of the affected VM. To undo enter "VBoxManage modifyvm "Windows 98SE" --cpu-profile host")
(In a Windows host the command syntax differs a bit.) This is the highest supported CPU (mine shows 3.6GHz) which runs pretty fast without too many limitations since Win98SE only uses one core anyway.


The most configurable virtual machine is VirtualBox. But worst is that even this one lacks "Guest Additions" drivers for DOS based OS, so by default it runs Win98SE only in 16 colour VGA mode (640x480) and you can not even copy files out of the virtual partition to save your work outside (except by sending through e-mail or FTP). You can copy files into the partition by making an ISO image (with a file compression program like xarchiver or 7-Zip) and mount it as virtual CD in VirtualBox, but with disabled 32bit filesystem of all that simulated CD-ROM drive will only show short DOS filenames, so you need to save ISO contents zipped to preserve long filenames.

VirtualBox Win98SE install shared folder on Samba

For easy file transfer out of the virtual Win98SE it is very recommended to create a shared folder inside the Win98SE VM and connect it through Samba to the outside (where it works like a normal LAN connection). But this is complicated because implementation is buggy and by default disabled in modern Samba versions.

I found no proper tutorials on this and never needed Samba before, so it was an ordeal to get there. This is my smb.conf (based on default, but without commented parts) for sharing only a folder inside the Win98SE on VirtualBox and nothing else.

Code: Select all

[global]
workgroup =
server string = %h server (Samba, Ubuntu)
wins support = no
dns proxy = no

log file = /var/log/samba/log.%m
max log size = 1000
logging = file
panic action = /usr/share/samba/panic-action %d

# Enable lanman to get SMB1 support for old Windows. 
# You may choose here LANMAN1 and enable plaintext auth for Win95 
# or other old DOS based OS. But Win98SE works safer without.

lanman auth = Yes
client lanman auth = Yes
;client plaintext auth = Yes
client min protocol = LANMAN2

server role = standalone server
obey pam restrictions = yes
unix password sync = no
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user

load printers = no
Install in Win98SE one of the inofficial service packs to get encrypted SMB1 support. You also need to to add the chosen WIN98SE user name and password to Samba to make it work.

Code: Select all

sudo smbpasswd -a WINDOWSUSERNAME
Regard that because of sudo you need to first type your own root password before it asks twice for the windows password, which can be confusing.

The LAN implementation in VirtualBox apparently has a very strange bug, thus in Win98SE you need to intentionally set a wrong workgroup name (i.e. a different one than in Samba smb.conf) to make Dolphin find it. So under Network the workgroup name from Win98SE will appear, and clicking it shows the name of the shared folder and its contents. In Win98SE do not set a password for that folder, else you can not access it (despite typing the password).

The path to the shared folder can be saved as link with the form "smb://COMPUTERNAME/FOLDERNAME" using computer- and folder names from Win98SE. ("smb://COMPUTERNAME" shows the folder). In Dolphin you can still access this URL even while the workgroup name is not found.

It took me days to understand the workgroup name bug. When both workgroup names match like intended, Dolphin fails to find it at all. In Win98SE also Explorer can not open the network neighbourhood, and I see that the IP address of Win98SE keeps getting portscanned at addresses 1030..1049(?) resulting in "TIME_WAIT" status. But when both workgroup names differ, Dolphin and Explorer can detect network neighborhood (including the Linux host name), and the IP address of Win98SE is only accessed through port 139 (like with file transfer) as expected by Lanman/SMB1 (which should only access 137,138,139).

I somehow suspect that the VM fails to properly translate the workgroup name encoding and somehow clogs a buffer with an endless feedback loop when Win98SE does not recognize changed copies of its own workgroup name as himself (like an animal attacking its own mirror image as a rival) and so rebroadcasts them again and again. (I am not LAN expert and may be wrong.)

With Smb4k I can not access the actual Win98SE workgroup (stays invisible) nor the share URL (shows error) at all but only see the unused workgroup name from smb.conf.

In Samba in smb.conf apparently the workgroup needs to wrong name to make both the Win98SE VM and host PC Samba become "Master Browser" (kind of local DNS server?). In this example smb.conf workgroup was set to "WORKGROUP", the Win98SE to "PLAYGROUP".

Code: Select all

co_windler@Juchhe:/etc/samba$ nmblookup w98_juchhe
XXX.XXX.XXX.20 w98_juchhe<00>

co_windler@Juchhe:/etc/samba$ nmblookup -A -T XXX.XXX.XXX.20 
Looking up status of XXX.XXX.XXX.20
        W98_JUCHHE      <00> -         B <ACTIVE> 
        PLAYGROUP       <00> - <GROUP> B <ACTIVE> 
        W98_JUCHHE      <03> -         B <ACTIVE> 
        W98_JUCHHE      <20> -         B <ACTIVE> 
        PLAYGROUP       <1e> - <GROUP> B <ACTIVE> 
        CO_WINDLER      <03> -         B <ACTIVE> 
        PLAYGROUP       <1d> -         B <ACTIVE> 
        ..__MSBROWSE__. <01> - <GROUP> B <ACTIVE> 

        MAC Address = XX-XX-XX-XX-XX-XX

co_windler@Juchhe:/etc/samba$ nmblookup workgroup
XXX.XXX.XXX.25 workgroup<00>

co_windler@Juchhe:/etc/samba$ nmblookup -A -T XXX.XXX.XXX.25
Looking up status of XXX.XXX.XXX.25
        JUCHHE          <00> -         B <ACTIVE> 
        JUCHHE          <03> -         B <ACTIVE> 
        JUCHHE          <20> -         B <ACTIVE> 
        ..__MSBROWSE__. <01> - <GROUP> B <ACTIVE> 
        WORKGROUP       <00> - <GROUP> B <ACTIVE> 
        WORKGROUP       <1d> -         B <ACTIVE> 
        WORKGROUP       <1e> - <GROUP> B <ACTIVE> 

        MAC Address = 00-00-00-00-00-00
I depend on Win98SE because I need e.g. certain graphics programs, and was shocked how badly it is supported on modern virtual machines and CPUs. Details see here:

HELP!: Who can fix Micrografx Picture Publisher 8?
https://forum.winehq.org/viewtopic.php?f=8&t=35142

As a collector and hardware researcher of music keyboards and soundtoys, for reference I keep on my harddisk some 10000 downloaded old eBay pages (consisting each of a HTML page and directory with media contents) and have some 100000 own digicam photos of hardware details etc. Yet I used for this Picture Publisher 8 on my main PC (Colani bigtower) for major photo rework jobs, but because the highend Win98SE machine (AMD K6-3+@550MHz, 768MB RAM) became completely overloaded with this work (160GB harddrive full to the brim and FAT32 too slow), I installed an additional modern ITX mainboard with AMD 2400G and 8TB harddrive running Linux Mint 20.1 with KDE 5 Plasma and WINE (using PlayOnLinux to switch versions).


:?: Is there a trick to properly setup one workgroup name, or is this impossible with Win98SE in the VM?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
MAY THE SOFTWARE BE WITH YOU!

I research hardware of old music keyboards and soundtoys.
http://weltenschule.de
Locked

Return to “Networking”