Any chance this feature could be ported to BasiliskII?Myrd wrote:I've committed a new feature to SheepShaver CVS. Currently, it is for Mac OS X and Unix only.
The idea is to allow for self-contained SheepShaver VMs, in a similar fashion to, for example, VMWare Fusion VMs.
BII support like in SheepShaver for self-contained bundles?
Moderators: Cat_7, Ronald P. Regensburg
BII support like in SheepShaver for self-contained bundles?
-
- Granny Smith
- Posts: 120
- Joined: Fri Nov 09, 2007 5:42 pm
Re: New Feature: Self-contained .sheepvm bundles
Does Basilisk II support something like this now?
- adespoton
- Forum All-Star
- Posts: 4277
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: New Feature: Self-contained .sheepvm bundles
Not officially, but I've cobbled together an equivalent. Basilisk II can load everything from the command line, so you can create a script that points to locally-referenced files for nvram, disk images, config file and ROM. Use something like Platypus to convert the script into an application, and you can even embed the BII binary inside, along with the other goodies, if you want. Otherwise, it'll just run using the default BII app, and you can have as many scripts as you want.
-
- Granny Smith
- Posts: 120
- Joined: Fri Nov 09, 2007 5:42 pm
Re: New Feature: Self-contained .sheepvm bundles
Thanks, I'm trying that workaround now.
if I call
I should have all the needed settings, like rom file, disk images etc. in that configFile, right?
But then it doesn't work, if I add it starts, but without any disk images.
So what is the configFile in the --config parameter supposed to be if it's not the equivalent to ~/.basilisk_ii_prefs?
edit: the problem are the relative paths. But I can't figure out how I need to write the script.
This results in "ERROR: Cannot open ROM file."
BasiliskII, the config file and rom are in the Resources Folder of the .App that Platypus created.
What am I doing wrong?
if I call
Code: Select all
./BasiliskII --config configFile
But then it doesn't work, if I add
Code: Select all
--rom romFile
So what is the configFile in the --config parameter supposed to be if it's not the equivalent to ~/.basilisk_ii_prefs?
edit: the problem are the relative paths. But I can't figure out how I need to write the script.
Code: Select all
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
./BasiliskII —-config basilisk_ii_prefs
BasiliskII, the config file and rom are in the Resources Folder of the .App that Platypus created.
What am I doing wrong?
- adespoton
- Forum All-Star
- Posts: 4277
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: New Feature: Self-contained .sheepvm bundles
I don't have access right now, but when I get home I'll pull up my script. CWD defaults to the location of the binary; I seem to recall I called cwd, stripped the MacOS folder and CD'd to ../Resources, at which point everything can be done as relative references.
Actually, I might have already pasted that script on here somewhere.
Actually, I might have already pasted that script on here somewhere.
-
- Granny Smith
- Posts: 120
- Joined: Fri Nov 09, 2007 5:42 pm
Re: New Feature: Self-contained .sheepvm bundles
Couldn't find a cwd command, besides in FTP which is just the cd command.
So, my first 2 lines
is just going to the location of the binary (well, the sh script) and doing the rest from there. I can run ./BasiliskII --config basilisk_ii_prefs but it doesn't find the ROM set in the prefs file even though it's right there. If I use ./BasiliskII --rom and point to the rom file like I do in the prefs file it works.
I don't understand it. Why does it not work when called with --config?
So, my first 2 lines
Code: Select all
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
I don't understand it. Why does it not work when called with --config?
-
- Granny Smith
- Posts: 120
- Joined: Fri Nov 09, 2007 5:42 pm
Re: BII support like in SheepShaver for self-contained bundl
@adespoton could you find anything yet?
- adespoton
- Forum All-Star
- Posts: 4277
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: BII support like in SheepShaver for self-contained bundl
Yes; finally at my Mac when I can pull this up:
That's what I do for BII -- I've put that script in the MacOS folder and told the Info.plist that this is the binary to launch. As you can see, this script also manages the xpram file, so you can have multiple BII instances running at the same time.
Code: Select all
#!/bin/sh
mypath=`dirname "$0"`
res="../Resources"
cd "$mypath"
mv "$res/nvram" ~/.basilisk_ii_xpram
"./MacOS 7.6.1" --config "../Resources/Config"
mv ~/.basilisk_ii_xpram "$res/xpram"
Re: BII support like in SheepShaver for self-contained bundl
Maybe I am just too rusty, but I don't quite get how this script lets you run more than one simultaneous machine/BII-instance in terms of the xpram. Please correct me if I am wrong.adespoton wrote:Yes; finally at my Mac when I can pull this up:
That's what I do for BII -- I've put that script in the MacOS folder and told the Info.plist that this is the binary to launch. As you can see, this script also manages the xpram file, so you can have multiple BII instances running at the same time.Code: Select all
#!/bin/sh mypath=`dirname "$0"` res="../Resources" cd "$mypath" mv "$res/nvram" ~/.basilisk_ii_xpram "./MacOS 7.6.1" --config "../Resources/Config" mv ~/.basilisk_ii_xpram "$res/xpram"
The mv copies/moves the one xpram to your home folder where Basilisk expects to find it. You open instance two, which overwrites the one in the home folder. The files are copied back on quit.
This would only work if the xpram is immediately read by BII on start, and written to only on exit, overwriting the file completely. If that is the case all is well. Else you would have BII one's file interfering with BII two's xpram potentially.
- adespoton
- Forum All-Star
- Posts: 4277
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: BII support like in SheepShaver for self-contained bundl
Yes -- it's a quick hack. However, it's also a bit more subtle than that -- the xpram gets written back after the BII process is spun up, not after it quits. This means that any changes made during the initial boot process will be written back, but any changes made during execution will be reverted on next execution.
So if you want to change something in xpram, you'll have to manually copy the xpram back after you shut down to replace the copy in the application bundle.
The result is that you want to wait until one BII instance is fully running before launching another, or else you might end up with the wrong xpram being written back, which can really mess things up (not just failure to boot, but subtle things like corrupted memory/disk images). Usually the OS's sanity check at boot is enough to prevent this issue, but if you change the file in mid-operation and then the OS reads from it... bad things can happen.
So if you want to change something in xpram, you'll have to manually copy the xpram back after you shut down to replace the copy in the application bundle.
The result is that you want to wait until one BII instance is fully running before launching another, or else you might end up with the wrong xpram being written back, which can really mess things up (not just failure to boot, but subtle things like corrupted memory/disk images). Usually the OS's sanity check at boot is enough to prevent this issue, but if you change the file in mid-operation and then the OS reads from it... bad things can happen.
Re: BII support like in SheepShaver for self-contained bundl
I'm still battling with this, probably because of pure ignorance on the Unix side. Please excuse the long full paths.adespoton wrote:Yes -- it's a quick hack. However, it's also a bit more subtle than that -- the xpram gets written back after the BII process is spun up, not after it quits.
Shell script named MacOS_8.1.sh:
Code: Select all
cd "/Users/peter/BasiliskConfigs/Runfolder_MacOS_8.1"
mv "/Users/peter/BasiliskConfigs/Runfolder_MacOS_8.1/xpram" "/Users/peter/.basilisk_ii_xpram"
echo Starting emulator
"/Users/peter/BasiliskConfigs/Runfolder_MacOS_8.1/BasiliskII_2014.app/Contents/MacOS/BasiliskII" --config "/Users/peter/BasiliskConfigs/Runfolder_MacOS_8.1/prefs"
echo Emulator Closing
echo Copying back
mv "/Users/peter/.basilisk_ii_xpram" "/Users/peter/BasiliskConfigs/Runfolder_MacOS_8.1/xpram"
echo Done
Code: Select all
Peters-MacBook-Pro:~ peter$ ./MacOS_8.1.sh
Starting emulator
Basilisk II V1.0 by Christian Bauer et al.
<snip whole lot of Basilisk stuff>
Sorting out untranslated instructions count...
Rank Opc Count Name
Emulator Closing
Copying back
Done
Re: BII support like in SheepShaver for self-contained bundl
Got it!!
Finally, after many searches, it all becomes simple. You can substitute another folder for your HOME folder in the shell script, and Basilisk puts the xpram in the new folder. Like so:
More testing to be done, but if this is correct it solves a whole bunch of problems ( and means a whole lot of re-coding for me! ). ( I'm feeling a bit stupid ).
Finally, after many searches, it all becomes simple. You can substitute another folder for your HOME folder in the shell script, and Basilisk puts the xpram in the new folder. Like so:
Code: Select all
HOME="/Users/peter/test/"
- adespoton
- Forum All-Star
- Posts: 4277
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: BII support like in SheepShaver for self-contained bundl
Well what do you know...
This works perfectly! The xprram file got written to the Resources folder!
I'm changing all my scripts over now
Code: Select all
#!/bin/sh
mypath=`dirname "$0"`
res="../Resources"
cd "$mypath"
HOME="$mypath/$res"
./BasiliskII --config "$HOME/Config"
I'm changing all my scripts over now
- sentient06
- Mac Mechanic
- Posts: 188
- Joined: Tue Mar 29, 2011 8:57 pm
- Location: London, UK
Re: BII support like in SheepShaver for self-contained bundl
adespoton, suppose I have several virtual machines in either self-contained wrappers or different config files. Is there a reason why I'd like to keep the xpram file?
I want to know if your interest is simply to keep these xpram files separate for each bundle so you don't have to manually remove it or if there is something useful about it.
I am researching to improve my UI config application. It deletes xpram automatically every time Basilisk II shuts down. I wonder if I should change the behaviour.
I want to know if your interest is simply to keep these xpram files separate for each bundle so you don't have to manually remove it or if there is something useful about it.
I am researching to improve my UI config application. It deletes xpram automatically every time Basilisk II shuts down. I wonder if I should change the behaviour.
- adespoton
- Forum All-Star
- Posts: 4277
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: BII support like in SheepShaver for self-contained bundl
I like to keep the xpram around because things like screen resolution and depth are set in there, as well as menu blink, mouse tracking, key repeat rate and parameters specific to the OS version booted last time. Being able to load from xpram avoids having to re-configure all that info after next boot, and speeds up the boot process.