LIVING ON AN island brings with it challenges many on the mainland don’t grasp, from being locked in during storms to being overrun by tourists during the summer season.

But those on Nantucket and Martha’s Vineyard are now facing a new question that their fellow Bay Staters won’t encounter: What about pot?

Massachusetts voters, like the other states that have approved legal marijuana, gave the green light to retail sales despite the fact it remains illegal to sell or possess it under federal law. As long as marijuana stays within state borders—and as long as the Trump administration doesn’t change the leave-states-alone approach adopted by the Obama administration—many believe there is little to worry about.

Not so for the islands off the state’s coast. Because the sea and air are under the jurisdiction of the federal government, carrying even a bud of weed between Nantucket or the Vineyard and the mainland is technically a violation of the federal controlled substance laws. That means all marijuana there has to be grown, manufactured, tested, sold, and consumed on the islands.

Many think federal officials will look the other way when it comes to legal marijuana shuttling over on the ferries, but the Coast Guard warns that is a risk people may not want to take.

“Since marijuana is still federally illegal, we enforce federal law,” says Petty Officer Andrew Baressi, a spokesman for the Coast Guard’s Boston station. “We don’t pick and choose what laws we enforce.”

Given the cost of land on both vacation destinations—Nantucket, at $2 million an acre, is the second most expensive place to buy land in Massachusetts—it will be a real test to find suitable sites for the full seed-to-sale process.

“It’s a really kind of a fascinating issue in trying to allow the islands to have access to marijuana—and these are islands that voted overwhelmingly in favor of legalization,” says freshman state Rep. Dylan Fernandes of Falmouth, whose district includes the Vineyard and Nantucket.

Year-round residents on both islands sent a strong message that they don’t want to be left out when the smoking lamp is lit. Nantucket voters approved the ballot question last year by a 64-36 margin, while the six small towns on the Vineyard all resoundingly said yes. In three of the Vineyard communities, the ballot measure won approval from 70 percent or more of voters.

Fernandes, along with state Sen. Julian Cyr of Truro, who also represents the islands, successfully amended the state’s recreational marijuana law to require the Cannabis Control Commission to come up with regulations to address the special issues facing the two islands by the time retail pot goes on the market.

Testing and supply are the two biggest concerns. While the regulations have yet to be worked out, testing will be required on all pot grown and products manufactured for contaminants and potency. There are currently two certified testing labs in Massachusetts on the mainland and a few more may open up. Cultivators and manufacturers can truck their wares to the labs for testing with the cost being kept relatively low because of the number of outlets that will be using the centrally located facilities.

On the islands, however, growers and manufacturers will have to pay for their own independent labs and that cost will inevitably be borne by consumers. Geoffrey Rose of Oak Bluffs, whose nonprofit has been approved by the state to open a medical marijuana dispensary in West Tisbury and who is considering a retail operation as well, said part of his permit requires him to pay for testing on-island. Between testing and finding suitable sites for cultivation and manufacturing, Rose says the price he charges for pot is likely to be high.

“It all goes into the cost of operation,” says Rose. “Every-thing costs more here.”

Fernandes, the Woods Hole representative, is pushing to get the state to subsidize pot testing on Nantucket and Martha’s Vineyard because of the hurdles stemming from the federal laws.

“How do you bring your marijuana to a testing facility if that testing facility is off-island?” Fernandes asks. “Are there ways for the state to subsidize testing facilities to come on island to shoulder some of the burden? I think we’re going to have some creative piece around testing.”

Another amendment to the law allows craft marijuana cultivators to produce marijuana for sale to retailers. The craft cultivators, similar to beer microbrewers, would be able to band together to grow marijuana plants and sell them wholesale, though not directly to consumers. How much marijuana craft cultivators could grow hasn’t been determined yet because regulations haven’t been written, but some on the islands hope local farmers would set aside some of their land for pot. “I think they’re probably going to have a lot, if not all, of their marijuana, homegrown on the island,” Fernandes says.

Many of the concerns percolating on Nantucket and Martha’s Vineyard arose on the islands of Puget Sound in the state of Washington, which legalized adult use of marijuana in 2012. Washington addressed the concerns by largely ignoring them. No testing facilities exist on the islands and no arrests have been made for transporting marijuana on state-operated ferries.

“We had a lot of growing pains and a lot of talk about what to do initially, but it hasn’t had a big impact on us,” says Ian Sterling, a spokesman for the Washington State Ferries. “If you have a box truck with a whole bunch of obvious markings about carrying marijuana, our people have to report it to the Coast Guard. But if people aren’t flagrant about it, I don’t think it’s something that gets noticed. We’re in the business of moving people, not moving pot. “

In Massachusetts, the Steamship Authority, a quasi-independent state authority that operates ferry service between Cape Cod and the islands, will be under some scrutiny once the sale of pot begins. Robert Davis, the authority’s general manager, says he and his crews have little leeway. “The guidance that the Coast Guard has issued is what we’d be adhering to,” says Davis. “Any vehicles coming on the property are subject to searches.”

At Hy-Line, which operates passenger-only ferries to the two islands out of Hyannis, officials toe the same line as the Coast Guard when it comes to what they’ll allow on board. But Richard Bigelow, head of security for Hy-Line, says pot is not at the top of his priority list.

“Today, in this climate, I’m probably less concerned about someone who has a small amount of medical marijuana than I am somebody carrying on explosives or weapons,” Bigelow says.