Self-contained Basilisk II VM for OSX (cool!)

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

User avatar
sentient06
Mac Mechanic
Posts: 187
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Self-contained Basilisk II VM for OSX (cool!)

Post by sentient06 »

Hello, i am making a few tests here and I came with a nice thingy to play with in Mac OS X, give it a try!

1. Get a Basilisk II Unix executable.

If you don't have one, do this:
- Get yourself a nice working version of Basilisk II, right-click it > show package contents.
- Go for Contents > MacOS
- Copy the file inside to another place. Usually the name is BasiliskII, I think. This is your executable.

My executable is named BasiliskIIIntel (I have several).

2. Get a small bootable disk image for test purposes. I got myself a bootable Mac OS 8.1 disk with the name macos81.img.
3. Get a working ROM file. Mine is called Performa 630.rom.
4. Find a very nice icon with the extension "icns". It can be done in "Icon composer" from the XCode package. I called it Icon.icns.

5. Put all these files in a new folder called Resources.
6. Create another folder called MacOS.
7. Inside MacOS, create an empty file with any name, extension ".sh". Mine is MacOS81.sh.

Write this to the file:

Code: Select all

#!/usr/bin/env bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
PAR="$( dirname "${DIR}" )"
RES_PATH="${PAR}/Resources"
RES=$( echo ${RES_PATH} | sed -e 's/ /\\ /g' )
eval "echo \"modelid 14\" > ${RES}/b2prefs"
eval "echo \"disk ${RES_PATH}/macos81.img\" >> ${RES}/b2prefs"
eval "echo \"screen win/800/500/32\" >> ${RES}/b2prefs"
eval "echo \"rom ${RES_PATH}/Performa 630.rom\" >> ${RES}/b2prefs"
eval "echo \"ramsize 33554432\" >> ${RES}/b2prefs"
eval "${RES}/BasiliskIIIntel --config ${RES}/b2prefs"
eval "rm ${RES}/b2prefs"
Remember to change the name of the files accordingly. The last line has the address of the executable Basilisk file, so it must match the name.

8. Put both folders (MacOS and Resources) inside a new folder called Contents.
9. With these folders, create a new file called Info.plist with the following content:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleExecutable</key>
    <string>MacOS81.sh</string>
    <key>CFBundleIconFile</key>
    <string>Icon.icns</string>
    <key>LSUIElement</key>
    <string>1</string>
</dict>
</plist>
Again, the name of the shell script must match here.

10. Now move the folder Contents inside another folder with any name.
11. Rename this parent-most folder to something like MacOS81.app. If asked to add extension, do it.

This is a basic structure to a basic OSX application. This particular structure basically contains all files necessary for the emulator to run. The preferences file is generated on the fly every time you open the bundle and is never stored in a system folder. It is also deleted after Basilisk is down. It makes the bundle virtually executable in any OSX machine even without the emulator installed.

12. Execute your new self-contained virtual machine and have fun!

Cheers!
emendelson
Forum All-Star
Posts: 1253
Joined: Tue Oct 14, 2008 12:12 am

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by emendelson »

This is really brilliant. Thank you!

I've adapted your method so that the b2prefs file points to a keyboard codes file in the same Resources folder with the rest.

Because I want to use the ~/Documents folder as the "Unix" folder, I've also added this line to the bash script:

eval "echo \"extfs /Users/$USER/Documents\" >> ${RES}/b2prefs"

This is something I've been hoping to find for years. Thank you again!
Gryffin
Student Driver
Posts: 19
Joined: Thu Oct 16, 2008 12:46 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Gryffin »

Huh. Followed this to the letter, on Mac OS X 10.8.4, but when I try to launch I get an error;

"You can't open 'MacOS81' because it may be damaged or incomplete."

Major bummer.
emendelson
Forum All-Star
Posts: 1253
Joined: Tue Oct 14, 2008 12:12 am

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by emendelson »

Control-click on it; choose Open from the contextual menu.
Gryffin
Student Driver
Posts: 19
Joined: Thu Oct 16, 2008 12:46 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Gryffin »

Just tried it. Same result, same error.
emendelson
Forum All-Star
Posts: 1253
Joined: Tue Oct 14, 2008 12:12 am

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by emendelson »

System Preferences -> Security and Privacy -> General

Click the lock; enter your password. Select Allow Applications downloaded from Anywhere.

Run Basilisk II once.

Return to System Preferences, etc., and set the Allow Applications setting to whatever you want.
User avatar
adespoton
Forum All-Star
Posts: 3247
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by adespoton »

He could also be having binary execution errors; with how your bundle is laid out though, I didn't want to get into troubleshooting that myself ;)
User avatar
Ronald P. Regensburg
Expert User
Posts: 6585
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Ronald P. Regensburg »

emendelson wrote:System Preferences -> Security and Privacy -> General

Click the lock; enter your password. Select Allow Applications downloaded from Anywhere.

Run Basilisk II once.

Return to System Preferences, etc., and set the Allow Applications setting to whatever you want.
The reported error is not the error one gets with an application that is not accepted by the Gatekeeper feature. I agree with "adespoton" that there could be, I think probably is, an issue with the constructed bundle laid out incorrectly.

Apparently it works for you, so the instructions are correct. Then I suppose "Gryffin" made a mistake somewhere while building the bundle.
emendelson
Forum All-Star
Posts: 1253
Joined: Tue Oct 14, 2008 12:12 am

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by emendelson »

adespoton wrote:He could also be having binary execution errors; with how your bundle is laid out though, I didn't want to get into troubleshooting that myself ;)
Not my bundle, sentient06's bundle - but his instructions worked perfectly the first time, and I've got a separate version of my own working perfectly.

Very easy test: ctrl-click; View Package Contents; double-click the BasiliskII executable; if it runs, then the problem is in the rest of the instructions.

One important part of the instructions is that the executable should be the executable inside a Basilisk II application, not the application itself. In the finder, it should look like a black rectangle, not an icon.
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

[EDIT]
Never mind; I figured it out, darn double directors ">>" instead of ">"
Here is the corrected CODE...

Code: Select all

#!/usr/bin/env bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
PAR="$( dirname "${DIR}" )"
RES_PATH="${PAR}/Resources"
RES=$( echo ${RES_PATH} | sed -e 's/ /\\ /g' )
eval "echo \"disk ${RES_PATH}/MacOS81.img\" >> ${RES}/b2prefs"
eval "echo \"extfs ${RES_PATH}/Shared\" >> ${RES}/b2prefs"
eval "echo \"screen win/1024/768\" >> ${RES}/b2prefs"
eval "echo \"seriala\" >> ${RES}/b2prefs"
eval "echo \"serialb\" >> ${RES}/b2prefs"
eval "echo \"ether slirp\" >> ${RES}/b2prefs"
eval "echo \"udptunnel false\" >> ${RES}/b2prefs"
eval "echo \"udpport 6066\" >> ${RES}/b2prefs"
eval "echo \"rom ${RES_PATH}/QUADRA 650.ROM\" >> ${RES}/b2prefs"
eval "echo \"bootdrive 0\" >> ${RES}/b2prefs"
eval "echo \"bootdriver 0\" >> ${RES}/b2prefs"
eval "echo \"ramsize 268435456\" >> ${RES}/b2prefs"
eval "echo \"frameskip 0\" >> ${RES}/b2prefs"
eval "echo \"modelid 14\" >> ${RES}/b2prefs"
eval "echo \"cpu 4\" >> ${RES}/b2prefs"
eval "echo \"fpu true\" >> ${RES}/b2prefs"
eval "echo \"nocdrom false\" >> ${RES}/b2prefs"
eval "echo \"nosound false\" >> ${RES}/b2prefs"
eval "echo \"noclipconversion false\" >> ${RES}/b2prefs"
eval "echo \"nogui false\" >> ${RES}/b2prefs"
eval "echo \"jit true\" >> ${RES}/b2prefs"
eval "echo \"jitfpu true\" >> ${RES}/b2prefs"
eval "echo \"jitdebug false\" >> ${RES}/b2prefs"
eval "echo \"jitcachesize 2048\" >> ${RES}/b2prefs"
eval "echo \"jitlazyflush true\" >> ${RES}/b2prefs"
eval "echo \"jitinline true\" >> ${RES}/b2prefs"
eval "echo \"keyboardtype 5\" >> ${RES}/b2prefs"
eval "echo \"keycodes false\" >> ${RES}/b2prefs"
eval "echo \"keycodefile ${RES_PATH}/BasiliskII_keycodes\" >> ${RES}/b2prefs"
eval "echo \"mousewheelmode 1\" >> ${RES}/b2prefs"
eval "echo \"mousewheellines 3\" >> ${RES}/b2prefs"
eval "echo \"dsp /dev/dsp\" >> ${RES}/b2prefs"
eval "echo \"mixer /dev/mixer\" >> ${RES}/b2prefs"
eval "echo \"ignoresegv true\" >> ${RES}/b2prefs"
eval "echo \"idlewait true\" >> ${RES}/b2prefs"
eval "${RES}/BasiliskIIIntel --config ${RES}/b2prefs"
eval "rm ${RES}/b2prefs"
[/EDIT]

Well after sorting out some execution privileges I got this to work. And so I thought I'll tweak and customize this to suit my needs; WRONG! I don't get it! Now, I keep getting the following:

Code: Select all

Last login: Mon Nov 10 11:59:52 on ttys000
Ryans-MacBook-Air:~ ryan$ /Users/ryan/Desktop/Mac\ OS\ 8.1.app/Contents/MacOS/MacOS81.sh ; exit;
Basilisk II V1.0 by Christian Bauer et al.
ERROR: Cannot open ROM file.
logout

[Process completed]
The file names are correct. AFAIK the permissions are correct. If I run the BasiliskIIIntel executable everything goes fine, but if I try to run the MacOS81.sh script I get the above error.
What am I doing wrong? Here is the code I have so far...

Code: Select all

#!/usr/bin/env bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
PAR="$( dirname "${DIR}" )"
RES_PATH="${PAR}/Resources"
RES=$( echo ${RES_PATH} | sed -e 's/ /\\ /g' )
eval "echo \"disk ${RES_PATH}/MacOS81.img\" >> ${RES}/b2prefs"
eval "echo \"extfs ${RES_PATH}/Shared\" >> ${RES}/b2prefs"
eval "echo \"screen win/1024/768\" >> ${RES}/b2prefs"
eval "echo \"seriala\" >> ${RES}/b2prefs"
eval "echo \"serialb\" >> ${RES}/b2prefs"
eval "echo \"ether slirp\" >> ${RES}/b2prefs"
eval "echo \"udptunnel false\" > ${RES}/b2prefs"
eval "echo \"udpport 6066\" > ${RES}/b2prefs"
eval "echo \"rom ${RES_PATH}/QUADRA 650.ROM\" >> ${RES}/b2prefs"
eval "echo \"bootdrive 0\" > ${RES}/b2prefs"
eval "echo \"bootdriver 0\" > ${RES}/b2prefs"
eval "echo \"ramsize 268435456\" >> ${RES}/b2prefs"
eval "echo \"frameskip 0\" > ${RES}/b2prefs"
eval "echo \"modelid 14\" > ${RES}/b2prefs"
eval "echo \"cpu 4\" > ${RES}/b2prefs"
eval "echo \"fpu true\" > ${RES}/b2prefs"
eval "echo \"nocdrom false\" > ${RES}/b2prefs"
eval "echo \"nosound false\" > ${RES}/b2prefs"
eval "echo \"noclipconversion false\" > ${RES}/b2prefs"
eval "echo \"nogui false\" > ${RES}/b2prefs"
eval "echo \"jit true\" > ${RES}/b2prefs"
eval "echo \"jitfpu true\" > ${RES}/b2prefs"
eval "echo \"jitdebug false\" > ${RES}/b2prefs"
eval "echo \"jitcachesize 2048\" > ${RES}/b2prefs"
eval "echo \"jitlazyflush true\" > ${RES}/b2prefs"
eval "echo \"jitinline true\" > ${RES}/b2prefs"
eval "echo \"keyboardtype 5\" > ${RES}/b2prefs"
eval "echo \"keycodes false\" > ${RES}/b2prefs"
eval "echo \"keycodefile ${RES_PATH}/BasiliskII_keycodes\" >> ${RES}/b2prefs"
eval "echo \"mousewheelmode 1\" > ${RES}/b2prefs"
eval "echo \"mousewheellines 3\" > ${RES}/b2prefs"
eval "echo \"dsp /dev/dsp\" > ${RES}/b2prefs"
eval "echo \"mixer /dev/mixer\" > ${RES}/b2prefs"
eval "echo \"ignoresegv true\" > ${RES}/b2prefs"
eval "echo \"idlewait true\" > ${RES}/b2prefs"
eval "${RES}/BasiliskIIIntel --config ${RES}/b2prefs"
eval "rm ${RES}/b2prefs"
and here is a snapshot of my Folder Contents in my Workspace
Image
Any ideas?
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

Can someone help me clean up my code a bit; especially the last line? As it is, it works, albeit not the most pragmatic or neatly way.

Code: Select all

#!/usr/bin/env bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
PAR="$( dirname "${DIR}" )"
RES_PATH="${PAR}/Resources"
RES=$( echo ${RES_PATH} | sed -e 's/ /\\ /g' )
eval "ln -fs \"${RES_PATH}/Pass-Through Drive\" ~/Desktop"
eval "echo \"disk ${RES_PATH}/MacOS81.img\" >> ${RES}/b2prefs"
eval "echo \"extfs ${RES_PATH}/Pass-Through Drive\" >> ${RES}/b2prefs"
eval "echo \"screen win/1024/768\" >> ${RES}/b2prefs"
eval "echo \"seriala\" >> ${RES}/b2prefs"
eval "echo \"serialb\" >> ${RES}/b2prefs"
eval "echo \"ether slirp\" >> ${RES}/b2prefs"
eval "echo \"udptunnel false\" >> ${RES}/b2prefs"
eval "echo \"udpport 6066\" >> ${RES}/b2prefs"
eval "echo \"rom ${RES_PATH}/QUADRA 650.ROM\" >> ${RES}/b2prefs"
eval "echo \"bootdrive 0\" >> ${RES}/b2prefs"
eval "echo \"bootdriver 0\" >> ${RES}/b2prefs"
eval "echo \"ramsize 268435456\" >> ${RES}/b2prefs"
eval "echo \"frameskip 0\" >> ${RES}/b2prefs"
eval "echo \"modelid 14\" >> ${RES}/b2prefs"
eval "echo \"cpu 4\" >> ${RES}/b2prefs"
eval "echo \"fpu true\" >> ${RES}/b2prefs"
eval "echo \"nocdrom false\" >> ${RES}/b2prefs"
eval "echo \"nosound false\" >> ${RES}/b2prefs"
eval "echo \"noclipconversion false\" >> ${RES}/b2prefs"
eval "echo \"nogui false\" >> ${RES}/b2prefs"
eval "echo \"jit true\" >> ${RES}/b2prefs"
eval "echo \"jitfpu true\" >> ${RES}/b2prefs"
eval "echo \"jitdebug false\" >> ${RES}/b2prefs"
eval "echo \"jitcachesize 2048\" >> ${RES}/b2prefs"
eval "echo \"jitlazyflush true\" >> ${RES}/b2prefs"
eval "echo \"jitinline true\" >> ${RES}/b2prefs"
eval "echo \"keyboardtype 5\" >> ${RES}/b2prefs"
eval "echo \"keycodes false\" >> ${RES}/b2prefs"
eval "echo \"keycodefile ${RES_PATH}/BasiliskII_keycodes\" >> ${RES}/b2prefs"
eval "echo \"mousewheelmode 1\" >> ${RES}/b2prefs"
eval "echo \"mousewheellines 3\" >> ${RES}/b2prefs"
eval "echo \"dsp /dev/dsp\" >> ${RES}/b2prefs"
eval "echo \"mixer /dev/mixer\" >> ${RES}/b2prefs"
eval "echo \"ignoresegv true\" >> ${RES}/b2prefs"
eval "echo \"idlewait true\" >> ${RES}/b2prefs"
eval "${RES}/BasiliskIIIntel --config ${RES}/b2prefs"
eval "rm ${RES}/b2prefs"
rm "$HOME/Desktop/Pass-Through Drive"
Here is my file contents...
Image
User avatar
adespoton
Forum All-Star
Posts: 3247
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by adespoton »

Mac8a wrote: The file names are correct. AFAIK the permissions are correct. If I run the BasiliskIIIntel executable everything goes fine, but if I try to run the MacOS81.sh script I get the above error.
What am I doing wrong? Here is the code I have so far...

Code: Select all

#!/usr/bin/env bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
PAR="$( dirname "${DIR}" )"
RES_PATH="${PAR}/Resources"
RES=$( echo ${RES_PATH} | sed -e 's/ /\\ /g' )
eval "echo \"disk ${RES_PATH}/MacOS81.img\" >> ${RES}/b2prefs"
eval "echo \"extfs ${RES_PATH}/Shared\" >> ${RES}/b2prefs"
eval "echo \"screen win/1024/768\" >> ${RES}/b2prefs"
eval "echo \"seriala\" >> ${RES}/b2prefs"
eval "echo \"serialb\" >> ${RES}/b2prefs"
eval "echo \"ether slirp\" >> ${RES}/b2prefs"
eval "echo \"udptunnel false\" > ${RES}/b2prefs"
eval "echo \"udpport 6066\" > ${RES}/b2prefs"
eval "echo \"rom ${RES_PATH}/QUADRA 650.ROM\" >> ${RES}/b2prefs"
eval "echo \"bootdrive 0\" > ${RES}/b2prefs"
eval "echo \"bootdriver 0\" > ${RES}/b2prefs"
eval "echo \"ramsize 268435456\" >> ${RES}/b2prefs"
eval "echo \"frameskip 0\" > ${RES}/b2prefs"
eval "echo \"modelid 14\" > ${RES}/b2prefs"
eval "echo \"cpu 4\" > ${RES}/b2prefs"
eval "echo \"fpu true\" > ${RES}/b2prefs"
eval "echo \"nocdrom false\" > ${RES}/b2prefs"
eval "echo \"nosound false\" > ${RES}/b2prefs"
eval "echo \"noclipconversion false\" > ${RES}/b2prefs"
eval "echo \"nogui false\" > ${RES}/b2prefs"
eval "echo \"jit true\" > ${RES}/b2prefs"
eval "echo \"jitfpu true\" > ${RES}/b2prefs"
eval "echo \"jitdebug false\" > ${RES}/b2prefs"
eval "echo \"jitcachesize 2048\" > ${RES}/b2prefs"
eval "echo \"jitlazyflush true\" > ${RES}/b2prefs"
eval "echo \"jitinline true\" > ${RES}/b2prefs"
eval "echo \"keyboardtype 5\" > ${RES}/b2prefs"
eval "echo \"keycodes false\" > ${RES}/b2prefs"
eval "echo \"keycodefile ${RES_PATH}/BasiliskII_keycodes\" >> ${RES}/b2prefs"
eval "echo \"mousewheelmode 1\" > ${RES}/b2prefs"
eval "echo \"mousewheellines 3\" > ${RES}/b2prefs"
eval "echo \"dsp /dev/dsp\" > ${RES}/b2prefs"
eval "echo \"mixer /dev/mixer\" > ${RES}/b2prefs"
eval "echo \"ignoresegv true\" > ${RES}/b2prefs"
eval "echo \"idlewait true\" > ${RES}/b2prefs"
eval "${RES}/BasiliskIIIntel --config ${RES}/b2prefs"
eval "rm ${RES}/b2prefs"
and here is a snapshot of my Folder Contents in my Workspace
Image
Any ideas?

Yeah; it's still sitting in the wrong folder when looking for the ROM file.

When I wrote my self-contained VM, I did it this way:

Code: Select all

#!/bin/sh
mypath=`dirname "$0"`
cd "$mypath"
./BasiliskII --config "../Resources/Config"
That way, all your config is in an editable file, and you're referencing it from the location that plays nice with BII. I have that as a launchb2 executable script file in my /Contents/MacOS folder. My Info.plist is tweaked to run that instead of BasiliskII.

Then in my Resources folder, I keep the rest of the stuff, including the Config file, which has this line:

Code: Select all

rom ../Resources/ROM
to point to the correct ROM location from where the executable/script sit.
All your eval lines would then sit in an easily readable Config file.
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

Thanks but I narrowed that problem down already it was me using ">" instead of ">>"

Any ideas how to clean up my new working code?
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

I kind of overlooked this... can you elaborate on this; especially the part about the eval being in another script or what not? What does your script look like in whole and what does your configuration file look like? How is it implemented? I would like some form of a proper solution to a self contained Basilisk II VM. I keep hearing eval is bad? I don't really know what I was doing, I just followed the OPs guide and expanded. But from talking to some other people it's not a very efficient solution. If you look at my code I did devise a way to place a temp link to a portable share so that while running the emulator the drive is easily accessible from the desktop and when not in use it's still stored in the self contained app for future use. Could your solution implement this feature?
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

Can this trick also be implemented with SheepShaver? I don't know how the configuration file is followed on SheepShaver.
User avatar
Ronald P. Regensburg
Expert User
Posts: 6585
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Ronald P. Regensburg »

Self-contained VMs is an existing feature of SheepShaver OSX itself. See this section in our setup manual: http://www.emaculation.com/doku.php/she ... l_machines
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

Ronald P. Regensburg wrote:Self-contained VMs is an existing feature of SheepShaver OSX itself. See this section in our setup manual: http://www.emaculation.com/doku.php/she ... l_machines
Thanks, but that method doesn't work for me. When I use .sheepvm extension, Mac OS X still looks at it like a folder of sorts, I can't place self contained .sheepvm files on the dock like I can apps; and I'd rather not have the config files hidden in my home folder but rather self-contained in an app file{I'm currently working on a solution of this} although the launch of sheepshaver does work with the .sheepvm extension.
User avatar
sentient06
Mac Mechanic
Posts: 187
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by sentient06 »

You could try nesting a sheepvm file within the bundle.

I am doing this with my editor Medusa. It saves the prefs file in a sheepvm file and executes SheepShaver using the path as an argument.

So while in basilisk you execute this line:

Code: Select all

./BasiliskII --config "../Resources/Config"
In SheepShaver you can do like this:

Code: Select all

./SheepShaver "../Resources/Config.sheepvm"
I did not test it, but in theory should work.
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

sentient06 wrote:You could try nesting a sheepvm file within the bundle.

I am doing this with my editor Medusa. It saves the prefs file in a sheepvm file and executes SheepShaver using the path as an argument.

So while in basilisk you execute this line:

Code: Select all

./BasiliskII --config "../Resources/Config"
In SheepShaver you can do like this:

Code: Select all

./SheepShaver "../Resources/Config.sheepvm"
I did not test it, but in theory should work.
I've mentioned in another post that Medusa isn't working for me; it won't read ROM files on OS X 10.10 Yosemite.
I'm currently writing AppleScripts to accomplish this, but I can't seem to figure out the proper syntax and arguments for "do script" command...

Code: Select all


set myRes to (path to me as text) & "Contents:Resources:"

tell application "Finder"
	make new alias to folder (myRes & "Pass-Through Drive") at desktop
end tell

tell application "Terminal"
	activate
	do script myRes & "BasilliskII --config " & myRes & "basilisk_ii_prefs"
end tell

tell application "Finder"
	delete file "Pass-Through Drive" of desktop
end tell
the shortcut on the desktop sections appear to work. But I'm getting trapped in POSIX format and Unix space hell when it comes to paths. If anyone has suggestions for a fix of this code; I'm all ears.
User avatar
Ronald P. Regensburg
Expert User
Posts: 6585
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Ronald P. Regensburg »

Mac8a wrote:
Ronald P. Regensburg wrote:Self-contained VMs is an existing feature of SheepShaver OSX itself. See this section in our setup manual: http://www.emaculation.com/doku.php/she ... l_machines
Thanks, but that method doesn't work for me. When I use .sheepvm extension, Mac OS X still looks at it like a folder of sorts, I can't place self contained .sheepvm files on the dock like I can apps; and I'd rather not have the config files hidden in my home folder but rather self-contained in an app file{I'm currently working on a solution of this} although the launch of sheepshaver does work with the .sheepvm extension.
Being about SheepShaver rather than BasiliskII, this is off-topic. But what you write needs answers.

- Yes, the .sheepvm is a bundle and is in fact a folder/directory just like all OSX bundles/packages, but in the Finder it behaves as a file.

- The .sheepvm VMs are not applications, so they cannot be added to the Dock in the left section. But they can be added in the section on the right. Clicking a VM icon in the Dock launches SheepShaver and starts the VM.

- The config files of the .sheepvm VMs are not hidden and not in your home folder. They are self-contained inside the VM. Each VM has its own "prefs" file which is readily visible inside the VM and can easily be viewed in any text editor.
Last edited by Ronald P. Regensburg on Wed Nov 12, 2014 7:05 pm, edited 1 time in total.
Reason:  
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

Ronald P. Regensburg wrote:
Mac8a wrote:
Ronald P. Regensburg wrote:Self-contained VMs is an existing feature of SheepShaver OSX itself. See this section in our setup manual: http://www.emaculation.com/doku.php/she ... l_machines
Thanks, but that method doesn't work for me. When I use .sheepvm extension, Mac OS X still looks at it like a folder of sorts, I can't place self contained .sheepvm files on the dock like I can apps; and I'd rather not have the config files hidden in my home folder but rather self-contained in an app file{I'm currently working on a solution of this} although the launch of sheepshaver does work with the .sheepvm extension.
Being about SheepShaver rather than BasiliskII, this is off-topic. But what you write needs answers.

- Yes, the .sheepvm is a bundle and is in fact a folder/directory just like all OSX bundles/packages, but in the Finder it behaves as a file.

- The .sheepvm VMs are not applications, so they cannot be added to the Dock in the left section. But they can be added in the section on the right. Clicking a VM icon in the Dock launches SheepShaver and starts the VM.

- The config files of the .sheepvm VMs are not hidden and not in your home folder. They are self-contained inside the VM. Each VM has its own "prefs" file which is readily visible inside the VM and can easily be viewed in any text editor.
Thanks for clearing that up; however, I would still like to be able to put a self contained SheepShaver VM on the "Left Side" of the Dock.
emendelson
Forum All-Star
Posts: 1253
Joined: Tue Oct 14, 2008 12:12 am

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by emendelson »

Mac8a wrote:I would still like to be able to put a self contained SheepShaver VM on the "Left Side" of the Dock.
You will have to ask Apple to make that possible. There are forums at apple.com where you can request added features.
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

emendelson wrote:
Mac8a wrote:I would still like to be able to put a self contained SheepShaver VM on the "Left Side" of the Dock.
You will have to ask Apple to make that possible. There are forums at apple.com where you can request added features.
Or I can simply make an App with Automator, AppleScript, or Self-Contained Bash Script.
emendelson
Forum All-Star
Posts: 1253
Joined: Tue Oct 14, 2008 12:12 am

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by emendelson »

Mac8a wrote:
emendelson wrote:You will have to ask Apple to make that possible. There are forums at apple.com where you can request added features.
Or I can simply make an App with Automator, AppleScript, or Self-Contained Bash Script.
Yes, of course: the SheepShaver Wrapper in a different part of the forum will do exactly what you are asking for, and it's already set up. The .sheepvm package alone can't go in the left part of the dock.
Mac8a
Student Driver
Posts: 19
Joined: Sun Nov 09, 2014 2:20 pm

Re: Self-contained Basilisk II VM for OSX (cool!)

Post by Mac8a »

I've tried to convert this to an AppleScript, but I get errors, could someone help me fix this please?

Code: Select all

set myRes to (path to me as text) & "Contents:Resources:"

set lnkRes to alias (path to me as text) & "Contents:Resources:"

tell application "Finder"
	make new alias to folder (myRes & "Pass-Through Drive") at desktop
end tell

set posixRes to (POSIX path of lnkRes)

do shell script quoted form of posixRes & "BasilliskII --config " & quoted form of posixRes & "basilisk_ii_prefs"

tell application "Finder"
	delete file "Pass-Through Drive" of desktop
end tell
Post Reply